pub struct RelativeTimeFormatter { /* private fields */ }
Expand description
A formatter to render locale-sensitive relative time.
§Example
use fixed_decimal::Decimal;
use icu::experimental::relativetime::{
RelativeTimeFormatter, RelativeTimeFormatterOptions,
};
use icu::locale::locale;
use writeable::assert_writeable_eq;
let relative_time_formatter = RelativeTimeFormatter::try_new_long_second(
locale!("en").into(),
RelativeTimeFormatterOptions::default(),
)
.expect("locale should be present");
assert_writeable_eq!(
relative_time_formatter.format(Decimal::from(5i8)),
"in 5 seconds"
);
assert_writeable_eq!(
relative_time_formatter.format(Decimal::from(-10i8)),
"10 seconds ago"
);
§Example
use fixed_decimal::Decimal;
use icu::experimental::relativetime::options::Numeric;
use icu::experimental::relativetime::{
RelativeTimeFormatter, RelativeTimeFormatterOptions,
};
use icu::locale::locale;
use writeable::assert_writeable_eq;
let relative_time_formatter = RelativeTimeFormatter::try_new_short_day(
locale!("es").into(),
RelativeTimeFormatterOptions {
numeric: Numeric::Auto,
},
)
.expect("locale should be present");
assert_writeable_eq!(
relative_time_formatter.format(Decimal::from(0u8)),
"hoy"
);
assert_writeable_eq!(
relative_time_formatter.format(Decimal::from(-2i8)),
"anteayer"
);
assert_writeable_eq!(
relative_time_formatter.format(Decimal::from(2u8)),
"pasado mañana"
);
assert_writeable_eq!(
relative_time_formatter.format(Decimal::from(15i8)),
"dentro de 15 d"
);
§Example
use fixed_decimal::Decimal;
use icu::experimental::relativetime::{
RelativeTimeFormatter, RelativeTimeFormatterOptions,
};
use icu::locale::locale;
use writeable::assert_writeable_eq;
let relative_time_formatter = RelativeTimeFormatter::try_new_narrow_year(
locale!("bn").into(),
RelativeTimeFormatterOptions::default(),
)
.expect("locale should be present");
assert_writeable_eq!(
relative_time_formatter.format(Decimal::from(3u8)),
"৩ বছরে"
);
assert_writeable_eq!(
relative_time_formatter.format(Decimal::from(-15i8)),
"১৫ বছর পূর্বে"
);
Implementations§
Source§impl RelativeTimeFormatter
impl RelativeTimeFormatter
Sourcepub fn try_new_long_second(
prefs: RelativeTimeFormatterPreferences,
options: RelativeTimeFormatterOptions,
) -> Result<Self, DataError>
pub fn try_new_long_second( prefs: RelativeTimeFormatterPreferences, options: RelativeTimeFormatterOptions, ) -> Result<Self, DataError>
Create a new RelativeTimeFormatter
from compiled data.
✨ Enabled with the compiled_data
Cargo feature.
Sourcepub fn try_new_long_second_with_buffer_provider(
provider: &(impl BufferProvider + ?Sized),
prefs: RelativeTimeFormatterPreferences,
options: RelativeTimeFormatterOptions,
) -> Result<Self, DataError>
pub fn try_new_long_second_with_buffer_provider( provider: &(impl BufferProvider + ?Sized), prefs: RelativeTimeFormatterPreferences, options: RelativeTimeFormatterOptions, ) -> Result<Self, DataError>
A version of [Self :: try_new_long_second
] that uses custom data provided by a BufferProvider
.
✨ Enabled with the serde
feature.
Sourcepub fn try_new_long_second_unstable<D>(
provider: &D,
prefs: RelativeTimeFormatterPreferences,
options: RelativeTimeFormatterOptions,
) -> Result<Self, DataError>where
D: DataProvider<PluralsCardinalV1> + DataProvider<LongSecondRelativeV1> + DataProvider<DecimalSymbolsV1> + DataProvider<DecimalDigitsV1> + ?Sized,
pub fn try_new_long_second_unstable<D>(
provider: &D,
prefs: RelativeTimeFormatterPreferences,
options: RelativeTimeFormatterOptions,
) -> Result<Self, DataError>where
D: DataProvider<PluralsCardinalV1> + DataProvider<LongSecondRelativeV1> + DataProvider<DecimalSymbolsV1> + DataProvider<DecimalDigitsV1> + ?Sized,
A version of [Self :: try_new_long_second
] that uses custom data provided by a DataProvider
.
Sourcepub fn try_new_long_minute(
prefs: RelativeTimeFormatterPreferences,
options: RelativeTimeFormatterOptions,
) -> Result<Self, DataError>
pub fn try_new_long_minute( prefs: RelativeTimeFormatterPreferences, options: RelativeTimeFormatterOptions, ) -> Result<Self, DataError>
Create a new RelativeTimeFormatter
from compiled data.
✨ Enabled with the compiled_data
Cargo feature.
Sourcepub fn try_new_long_minute_with_buffer_provider(
provider: &(impl BufferProvider + ?Sized),
prefs: RelativeTimeFormatterPreferences,
options: RelativeTimeFormatterOptions,
) -> Result<Self, DataError>
pub fn try_new_long_minute_with_buffer_provider( provider: &(impl BufferProvider + ?Sized), prefs: RelativeTimeFormatterPreferences, options: RelativeTimeFormatterOptions, ) -> Result<Self, DataError>
A version of [Self :: try_new_long_minute
] that uses custom data provided by a BufferProvider
.
✨ Enabled with the serde
feature.
Sourcepub fn try_new_long_minute_unstable<D>(
provider: &D,
prefs: RelativeTimeFormatterPreferences,
options: RelativeTimeFormatterOptions,
) -> Result<Self, DataError>where
D: DataProvider<PluralsCardinalV1> + DataProvider<LongMinuteRelativeV1> + DataProvider<DecimalSymbolsV1> + DataProvider<DecimalDigitsV1> + ?Sized,
pub fn try_new_long_minute_unstable<D>(
provider: &D,
prefs: RelativeTimeFormatterPreferences,
options: RelativeTimeFormatterOptions,
) -> Result<Self, DataError>where
D: DataProvider<PluralsCardinalV1> + DataProvider<LongMinuteRelativeV1> + DataProvider<DecimalSymbolsV1> + DataProvider<DecimalDigitsV1> + ?Sized,
A version of [Self :: try_new_long_minute
] that uses custom data provided by a DataProvider
.
Sourcepub fn try_new_long_hour(
prefs: RelativeTimeFormatterPreferences,
options: RelativeTimeFormatterOptions,
) -> Result<Self, DataError>
pub fn try_new_long_hour( prefs: RelativeTimeFormatterPreferences, options: RelativeTimeFormatterOptions, ) -> Result<Self, DataError>
Create a new RelativeTimeFormatter
from compiled data.
✨ Enabled with the compiled_data
Cargo feature.
Sourcepub fn try_new_long_hour_with_buffer_provider(
provider: &(impl BufferProvider + ?Sized),
prefs: RelativeTimeFormatterPreferences,
options: RelativeTimeFormatterOptions,
) -> Result<Self, DataError>
pub fn try_new_long_hour_with_buffer_provider( provider: &(impl BufferProvider + ?Sized), prefs: RelativeTimeFormatterPreferences, options: RelativeTimeFormatterOptions, ) -> Result<Self, DataError>
A version of [Self :: try_new_long_hour
] that uses custom data provided by a BufferProvider
.
✨ Enabled with the serde
feature.
Sourcepub fn try_new_long_hour_unstable<D>(
provider: &D,
prefs: RelativeTimeFormatterPreferences,
options: RelativeTimeFormatterOptions,
) -> Result<Self, DataError>where
D: DataProvider<PluralsCardinalV1> + DataProvider<LongHourRelativeV1> + DataProvider<DecimalSymbolsV1> + DataProvider<DecimalDigitsV1> + ?Sized,
pub fn try_new_long_hour_unstable<D>(
provider: &D,
prefs: RelativeTimeFormatterPreferences,
options: RelativeTimeFormatterOptions,
) -> Result<Self, DataError>where
D: DataProvider<PluralsCardinalV1> + DataProvider<LongHourRelativeV1> + DataProvider<DecimalSymbolsV1> + DataProvider<DecimalDigitsV1> + ?Sized,
A version of [Self :: try_new_long_hour
] that uses custom data provided by a DataProvider
.
Sourcepub fn try_new_long_day(
prefs: RelativeTimeFormatterPreferences,
options: RelativeTimeFormatterOptions,
) -> Result<Self, DataError>
pub fn try_new_long_day( prefs: RelativeTimeFormatterPreferences, options: RelativeTimeFormatterOptions, ) -> Result<Self, DataError>
Create a new RelativeTimeFormatter
from compiled data.
✨ Enabled with the compiled_data
Cargo feature.
Sourcepub fn try_new_long_day_with_buffer_provider(
provider: &(impl BufferProvider + ?Sized),
prefs: RelativeTimeFormatterPreferences,
options: RelativeTimeFormatterOptions,
) -> Result<Self, DataError>
pub fn try_new_long_day_with_buffer_provider( provider: &(impl BufferProvider + ?Sized), prefs: RelativeTimeFormatterPreferences, options: RelativeTimeFormatterOptions, ) -> Result<Self, DataError>
A version of [Self :: try_new_long_day
] that uses custom data provided by a BufferProvider
.
✨ Enabled with the serde
feature.
Sourcepub fn try_new_long_day_unstable<D>(
provider: &D,
prefs: RelativeTimeFormatterPreferences,
options: RelativeTimeFormatterOptions,
) -> Result<Self, DataError>where
D: DataProvider<PluralsCardinalV1> + DataProvider<LongDayRelativeV1> + DataProvider<DecimalSymbolsV1> + DataProvider<DecimalDigitsV1> + ?Sized,
pub fn try_new_long_day_unstable<D>(
provider: &D,
prefs: RelativeTimeFormatterPreferences,
options: RelativeTimeFormatterOptions,
) -> Result<Self, DataError>where
D: DataProvider<PluralsCardinalV1> + DataProvider<LongDayRelativeV1> + DataProvider<DecimalSymbolsV1> + DataProvider<DecimalDigitsV1> + ?Sized,
A version of [Self :: try_new_long_day
] that uses custom data provided by a DataProvider
.
Sourcepub fn try_new_long_week(
prefs: RelativeTimeFormatterPreferences,
options: RelativeTimeFormatterOptions,
) -> Result<Self, DataError>
pub fn try_new_long_week( prefs: RelativeTimeFormatterPreferences, options: RelativeTimeFormatterOptions, ) -> Result<Self, DataError>
Create a new RelativeTimeFormatter
from compiled data.
✨ Enabled with the compiled_data
Cargo feature.
Sourcepub fn try_new_long_week_with_buffer_provider(
provider: &(impl BufferProvider + ?Sized),
prefs: RelativeTimeFormatterPreferences,
options: RelativeTimeFormatterOptions,
) -> Result<Self, DataError>
pub fn try_new_long_week_with_buffer_provider( provider: &(impl BufferProvider + ?Sized), prefs: RelativeTimeFormatterPreferences, options: RelativeTimeFormatterOptions, ) -> Result<Self, DataError>
A version of [Self :: try_new_long_week
] that uses custom data provided by a BufferProvider
.
✨ Enabled with the serde
feature.
Sourcepub fn try_new_long_week_unstable<D>(
provider: &D,
prefs: RelativeTimeFormatterPreferences,
options: RelativeTimeFormatterOptions,
) -> Result<Self, DataError>where
D: DataProvider<PluralsCardinalV1> + DataProvider<LongWeekRelativeV1> + DataProvider<DecimalSymbolsV1> + DataProvider<DecimalDigitsV1> + ?Sized,
pub fn try_new_long_week_unstable<D>(
provider: &D,
prefs: RelativeTimeFormatterPreferences,
options: RelativeTimeFormatterOptions,
) -> Result<Self, DataError>where
D: DataProvider<PluralsCardinalV1> + DataProvider<LongWeekRelativeV1> + DataProvider<DecimalSymbolsV1> + DataProvider<DecimalDigitsV1> + ?Sized,
A version of [Self :: try_new_long_week
] that uses custom data provided by a DataProvider
.
Sourcepub fn try_new_long_month(
prefs: RelativeTimeFormatterPreferences,
options: RelativeTimeFormatterOptions,
) -> Result<Self, DataError>
pub fn try_new_long_month( prefs: RelativeTimeFormatterPreferences, options: RelativeTimeFormatterOptions, ) -> Result<Self, DataError>
Create a new RelativeTimeFormatter
from compiled data.
✨ Enabled with the compiled_data
Cargo feature.
Sourcepub fn try_new_long_month_with_buffer_provider(
provider: &(impl BufferProvider + ?Sized),
prefs: RelativeTimeFormatterPreferences,
options: RelativeTimeFormatterOptions,
) -> Result<Self, DataError>
pub fn try_new_long_month_with_buffer_provider( provider: &(impl BufferProvider + ?Sized), prefs: RelativeTimeFormatterPreferences, options: RelativeTimeFormatterOptions, ) -> Result<Self, DataError>
A version of [Self :: try_new_long_month
] that uses custom data provided by a BufferProvider
.
✨ Enabled with the serde
feature.
Sourcepub fn try_new_long_month_unstable<D>(
provider: &D,
prefs: RelativeTimeFormatterPreferences,
options: RelativeTimeFormatterOptions,
) -> Result<Self, DataError>where
D: DataProvider<PluralsCardinalV1> + DataProvider<LongMonthRelativeV1> + DataProvider<DecimalSymbolsV1> + DataProvider<DecimalDigitsV1> + ?Sized,
pub fn try_new_long_month_unstable<D>(
provider: &D,
prefs: RelativeTimeFormatterPreferences,
options: RelativeTimeFormatterOptions,
) -> Result<Self, DataError>where
D: DataProvider<PluralsCardinalV1> + DataProvider<LongMonthRelativeV1> + DataProvider<DecimalSymbolsV1> + DataProvider<DecimalDigitsV1> + ?Sized,
A version of [Self :: try_new_long_month
] that uses custom data provided by a DataProvider
.
Sourcepub fn try_new_long_quarter(
prefs: RelativeTimeFormatterPreferences,
options: RelativeTimeFormatterOptions,
) -> Result<Self, DataError>
pub fn try_new_long_quarter( prefs: RelativeTimeFormatterPreferences, options: RelativeTimeFormatterOptions, ) -> Result<Self, DataError>
Create a new RelativeTimeFormatter
from compiled data.
✨ Enabled with the compiled_data
Cargo feature.
Sourcepub fn try_new_long_quarter_with_buffer_provider(
provider: &(impl BufferProvider + ?Sized),
prefs: RelativeTimeFormatterPreferences,
options: RelativeTimeFormatterOptions,
) -> Result<Self, DataError>
pub fn try_new_long_quarter_with_buffer_provider( provider: &(impl BufferProvider + ?Sized), prefs: RelativeTimeFormatterPreferences, options: RelativeTimeFormatterOptions, ) -> Result<Self, DataError>
A version of [Self :: try_new_long_quarter
] that uses custom data provided by a BufferProvider
.
✨ Enabled with the serde
feature.
Sourcepub fn try_new_long_quarter_unstable<D>(
provider: &D,
prefs: RelativeTimeFormatterPreferences,
options: RelativeTimeFormatterOptions,
) -> Result<Self, DataError>where
D: DataProvider<PluralsCardinalV1> + DataProvider<LongQuarterRelativeV1> + DataProvider<DecimalSymbolsV1> + DataProvider<DecimalDigitsV1> + ?Sized,
pub fn try_new_long_quarter_unstable<D>(
provider: &D,
prefs: RelativeTimeFormatterPreferences,
options: RelativeTimeFormatterOptions,
) -> Result<Self, DataError>where
D: DataProvider<PluralsCardinalV1> + DataProvider<LongQuarterRelativeV1> + DataProvider<DecimalSymbolsV1> + DataProvider<DecimalDigitsV1> + ?Sized,
A version of [Self :: try_new_long_quarter
] that uses custom data provided by a DataProvider
.
Sourcepub fn try_new_long_year(
prefs: RelativeTimeFormatterPreferences,
options: RelativeTimeFormatterOptions,
) -> Result<Self, DataError>
pub fn try_new_long_year( prefs: RelativeTimeFormatterPreferences, options: RelativeTimeFormatterOptions, ) -> Result<Self, DataError>
Create a new RelativeTimeFormatter
from compiled data.
✨ Enabled with the compiled_data
Cargo feature.
Sourcepub fn try_new_long_year_with_buffer_provider(
provider: &(impl BufferProvider + ?Sized),
prefs: RelativeTimeFormatterPreferences,
options: RelativeTimeFormatterOptions,
) -> Result<Self, DataError>
pub fn try_new_long_year_with_buffer_provider( provider: &(impl BufferProvider + ?Sized), prefs: RelativeTimeFormatterPreferences, options: RelativeTimeFormatterOptions, ) -> Result<Self, DataError>
A version of [Self :: try_new_long_year
] that uses custom data provided by a BufferProvider
.
✨ Enabled with the serde
feature.
Sourcepub fn try_new_long_year_unstable<D>(
provider: &D,
prefs: RelativeTimeFormatterPreferences,
options: RelativeTimeFormatterOptions,
) -> Result<Self, DataError>where
D: DataProvider<PluralsCardinalV1> + DataProvider<LongYearRelativeV1> + DataProvider<DecimalSymbolsV1> + DataProvider<DecimalDigitsV1> + ?Sized,
pub fn try_new_long_year_unstable<D>(
provider: &D,
prefs: RelativeTimeFormatterPreferences,
options: RelativeTimeFormatterOptions,
) -> Result<Self, DataError>where
D: DataProvider<PluralsCardinalV1> + DataProvider<LongYearRelativeV1> + DataProvider<DecimalSymbolsV1> + DataProvider<DecimalDigitsV1> + ?Sized,
A version of [Self :: try_new_long_year
] that uses custom data provided by a DataProvider
.
Sourcepub fn try_new_short_second(
prefs: RelativeTimeFormatterPreferences,
options: RelativeTimeFormatterOptions,
) -> Result<Self, DataError>
pub fn try_new_short_second( prefs: RelativeTimeFormatterPreferences, options: RelativeTimeFormatterOptions, ) -> Result<Self, DataError>
Create a new RelativeTimeFormatter
from compiled data.
✨ Enabled with the compiled_data
Cargo feature.
Sourcepub fn try_new_short_second_with_buffer_provider(
provider: &(impl BufferProvider + ?Sized),
prefs: RelativeTimeFormatterPreferences,
options: RelativeTimeFormatterOptions,
) -> Result<Self, DataError>
pub fn try_new_short_second_with_buffer_provider( provider: &(impl BufferProvider + ?Sized), prefs: RelativeTimeFormatterPreferences, options: RelativeTimeFormatterOptions, ) -> Result<Self, DataError>
A version of [Self :: try_new_short_second
] that uses custom data provided by a BufferProvider
.
✨ Enabled with the serde
feature.
Sourcepub fn try_new_short_second_unstable<D>(
provider: &D,
prefs: RelativeTimeFormatterPreferences,
options: RelativeTimeFormatterOptions,
) -> Result<Self, DataError>where
D: DataProvider<PluralsCardinalV1> + DataProvider<ShortSecondRelativeV1> + DataProvider<DecimalSymbolsV1> + DataProvider<DecimalDigitsV1> + ?Sized,
pub fn try_new_short_second_unstable<D>(
provider: &D,
prefs: RelativeTimeFormatterPreferences,
options: RelativeTimeFormatterOptions,
) -> Result<Self, DataError>where
D: DataProvider<PluralsCardinalV1> + DataProvider<ShortSecondRelativeV1> + DataProvider<DecimalSymbolsV1> + DataProvider<DecimalDigitsV1> + ?Sized,
A version of [Self :: try_new_short_second
] that uses custom data provided by a DataProvider
.
Sourcepub fn try_new_short_minute(
prefs: RelativeTimeFormatterPreferences,
options: RelativeTimeFormatterOptions,
) -> Result<Self, DataError>
pub fn try_new_short_minute( prefs: RelativeTimeFormatterPreferences, options: RelativeTimeFormatterOptions, ) -> Result<Self, DataError>
Create a new RelativeTimeFormatter
from compiled data.
✨ Enabled with the compiled_data
Cargo feature.
Sourcepub fn try_new_short_minute_with_buffer_provider(
provider: &(impl BufferProvider + ?Sized),
prefs: RelativeTimeFormatterPreferences,
options: RelativeTimeFormatterOptions,
) -> Result<Self, DataError>
pub fn try_new_short_minute_with_buffer_provider( provider: &(impl BufferProvider + ?Sized), prefs: RelativeTimeFormatterPreferences, options: RelativeTimeFormatterOptions, ) -> Result<Self, DataError>
A version of [Self :: try_new_short_minute
] that uses custom data provided by a BufferProvider
.
✨ Enabled with the serde
feature.
Sourcepub fn try_new_short_minute_unstable<D>(
provider: &D,
prefs: RelativeTimeFormatterPreferences,
options: RelativeTimeFormatterOptions,
) -> Result<Self, DataError>where
D: DataProvider<PluralsCardinalV1> + DataProvider<ShortMinuteRelativeV1> + DataProvider<DecimalSymbolsV1> + DataProvider<DecimalDigitsV1> + ?Sized,
pub fn try_new_short_minute_unstable<D>(
provider: &D,
prefs: RelativeTimeFormatterPreferences,
options: RelativeTimeFormatterOptions,
) -> Result<Self, DataError>where
D: DataProvider<PluralsCardinalV1> + DataProvider<ShortMinuteRelativeV1> + DataProvider<DecimalSymbolsV1> + DataProvider<DecimalDigitsV1> + ?Sized,
A version of [Self :: try_new_short_minute
] that uses custom data provided by a DataProvider
.
Sourcepub fn try_new_short_hour(
prefs: RelativeTimeFormatterPreferences,
options: RelativeTimeFormatterOptions,
) -> Result<Self, DataError>
pub fn try_new_short_hour( prefs: RelativeTimeFormatterPreferences, options: RelativeTimeFormatterOptions, ) -> Result<Self, DataError>
Create a new RelativeTimeFormatter
from compiled data.
✨ Enabled with the compiled_data
Cargo feature.
Sourcepub fn try_new_short_hour_with_buffer_provider(
provider: &(impl BufferProvider + ?Sized),
prefs: RelativeTimeFormatterPreferences,
options: RelativeTimeFormatterOptions,
) -> Result<Self, DataError>
pub fn try_new_short_hour_with_buffer_provider( provider: &(impl BufferProvider + ?Sized), prefs: RelativeTimeFormatterPreferences, options: RelativeTimeFormatterOptions, ) -> Result<Self, DataError>
A version of [Self :: try_new_short_hour
] that uses custom data provided by a BufferProvider
.
✨ Enabled with the serde
feature.
Sourcepub fn try_new_short_hour_unstable<D>(
provider: &D,
prefs: RelativeTimeFormatterPreferences,
options: RelativeTimeFormatterOptions,
) -> Result<Self, DataError>where
D: DataProvider<PluralsCardinalV1> + DataProvider<ShortHourRelativeV1> + DataProvider<DecimalSymbolsV1> + DataProvider<DecimalDigitsV1> + ?Sized,
pub fn try_new_short_hour_unstable<D>(
provider: &D,
prefs: RelativeTimeFormatterPreferences,
options: RelativeTimeFormatterOptions,
) -> Result<Self, DataError>where
D: DataProvider<PluralsCardinalV1> + DataProvider<ShortHourRelativeV1> + DataProvider<DecimalSymbolsV1> + DataProvider<DecimalDigitsV1> + ?Sized,
A version of [Self :: try_new_short_hour
] that uses custom data provided by a DataProvider
.
Sourcepub fn try_new_short_day(
prefs: RelativeTimeFormatterPreferences,
options: RelativeTimeFormatterOptions,
) -> Result<Self, DataError>
pub fn try_new_short_day( prefs: RelativeTimeFormatterPreferences, options: RelativeTimeFormatterOptions, ) -> Result<Self, DataError>
Create a new RelativeTimeFormatter
from compiled data.
✨ Enabled with the compiled_data
Cargo feature.
Sourcepub fn try_new_short_day_with_buffer_provider(
provider: &(impl BufferProvider + ?Sized),
prefs: RelativeTimeFormatterPreferences,
options: RelativeTimeFormatterOptions,
) -> Result<Self, DataError>
pub fn try_new_short_day_with_buffer_provider( provider: &(impl BufferProvider + ?Sized), prefs: RelativeTimeFormatterPreferences, options: RelativeTimeFormatterOptions, ) -> Result<Self, DataError>
A version of [Self :: try_new_short_day
] that uses custom data provided by a BufferProvider
.
✨ Enabled with the serde
feature.
Sourcepub fn try_new_short_day_unstable<D>(
provider: &D,
prefs: RelativeTimeFormatterPreferences,
options: RelativeTimeFormatterOptions,
) -> Result<Self, DataError>where
D: DataProvider<PluralsCardinalV1> + DataProvider<ShortDayRelativeV1> + DataProvider<DecimalSymbolsV1> + DataProvider<DecimalDigitsV1> + ?Sized,
pub fn try_new_short_day_unstable<D>(
provider: &D,
prefs: RelativeTimeFormatterPreferences,
options: RelativeTimeFormatterOptions,
) -> Result<Self, DataError>where
D: DataProvider<PluralsCardinalV1> + DataProvider<ShortDayRelativeV1> + DataProvider<DecimalSymbolsV1> + DataProvider<DecimalDigitsV1> + ?Sized,
A version of [Self :: try_new_short_day
] that uses custom data provided by a DataProvider
.
Sourcepub fn try_new_short_week(
prefs: RelativeTimeFormatterPreferences,
options: RelativeTimeFormatterOptions,
) -> Result<Self, DataError>
pub fn try_new_short_week( prefs: RelativeTimeFormatterPreferences, options: RelativeTimeFormatterOptions, ) -> Result<Self, DataError>
Create a new RelativeTimeFormatter
from compiled data.
✨ Enabled with the compiled_data
Cargo feature.
Sourcepub fn try_new_short_week_with_buffer_provider(
provider: &(impl BufferProvider + ?Sized),
prefs: RelativeTimeFormatterPreferences,
options: RelativeTimeFormatterOptions,
) -> Result<Self, DataError>
pub fn try_new_short_week_with_buffer_provider( provider: &(impl BufferProvider + ?Sized), prefs: RelativeTimeFormatterPreferences, options: RelativeTimeFormatterOptions, ) -> Result<Self, DataError>
A version of [Self :: try_new_short_week
] that uses custom data provided by a BufferProvider
.
✨ Enabled with the serde
feature.
Sourcepub fn try_new_short_week_unstable<D>(
provider: &D,
prefs: RelativeTimeFormatterPreferences,
options: RelativeTimeFormatterOptions,
) -> Result<Self, DataError>where
D: DataProvider<PluralsCardinalV1> + DataProvider<ShortWeekRelativeV1> + DataProvider<DecimalSymbolsV1> + DataProvider<DecimalDigitsV1> + ?Sized,
pub fn try_new_short_week_unstable<D>(
provider: &D,
prefs: RelativeTimeFormatterPreferences,
options: RelativeTimeFormatterOptions,
) -> Result<Self, DataError>where
D: DataProvider<PluralsCardinalV1> + DataProvider<ShortWeekRelativeV1> + DataProvider<DecimalSymbolsV1> + DataProvider<DecimalDigitsV1> + ?Sized,
A version of [Self :: try_new_short_week
] that uses custom data provided by a DataProvider
.
Sourcepub fn try_new_short_month(
prefs: RelativeTimeFormatterPreferences,
options: RelativeTimeFormatterOptions,
) -> Result<Self, DataError>
pub fn try_new_short_month( prefs: RelativeTimeFormatterPreferences, options: RelativeTimeFormatterOptions, ) -> Result<Self, DataError>
Create a new RelativeTimeFormatter
from compiled data.
✨ Enabled with the compiled_data
Cargo feature.
Sourcepub fn try_new_short_month_with_buffer_provider(
provider: &(impl BufferProvider + ?Sized),
prefs: RelativeTimeFormatterPreferences,
options: RelativeTimeFormatterOptions,
) -> Result<Self, DataError>
pub fn try_new_short_month_with_buffer_provider( provider: &(impl BufferProvider + ?Sized), prefs: RelativeTimeFormatterPreferences, options: RelativeTimeFormatterOptions, ) -> Result<Self, DataError>
A version of [Self :: try_new_short_month
] that uses custom data provided by a BufferProvider
.
✨ Enabled with the serde
feature.
Sourcepub fn try_new_short_month_unstable<D>(
provider: &D,
prefs: RelativeTimeFormatterPreferences,
options: RelativeTimeFormatterOptions,
) -> Result<Self, DataError>where
D: DataProvider<PluralsCardinalV1> + DataProvider<ShortMonthRelativeV1> + DataProvider<DecimalSymbolsV1> + DataProvider<DecimalDigitsV1> + ?Sized,
pub fn try_new_short_month_unstable<D>(
provider: &D,
prefs: RelativeTimeFormatterPreferences,
options: RelativeTimeFormatterOptions,
) -> Result<Self, DataError>where
D: DataProvider<PluralsCardinalV1> + DataProvider<ShortMonthRelativeV1> + DataProvider<DecimalSymbolsV1> + DataProvider<DecimalDigitsV1> + ?Sized,
A version of [Self :: try_new_short_month
] that uses custom data provided by a DataProvider
.
Sourcepub fn try_new_short_quarter(
prefs: RelativeTimeFormatterPreferences,
options: RelativeTimeFormatterOptions,
) -> Result<Self, DataError>
pub fn try_new_short_quarter( prefs: RelativeTimeFormatterPreferences, options: RelativeTimeFormatterOptions, ) -> Result<Self, DataError>
Create a new RelativeTimeFormatter
from compiled data.
✨ Enabled with the compiled_data
Cargo feature.
Sourcepub fn try_new_short_quarter_with_buffer_provider(
provider: &(impl BufferProvider + ?Sized),
prefs: RelativeTimeFormatterPreferences,
options: RelativeTimeFormatterOptions,
) -> Result<Self, DataError>
pub fn try_new_short_quarter_with_buffer_provider( provider: &(impl BufferProvider + ?Sized), prefs: RelativeTimeFormatterPreferences, options: RelativeTimeFormatterOptions, ) -> Result<Self, DataError>
A version of [Self :: try_new_short_quarter
] that uses custom data provided by a BufferProvider
.
✨ Enabled with the serde
feature.
Sourcepub fn try_new_short_quarter_unstable<D>(
provider: &D,
prefs: RelativeTimeFormatterPreferences,
options: RelativeTimeFormatterOptions,
) -> Result<Self, DataError>where
D: DataProvider<PluralsCardinalV1> + DataProvider<ShortQuarterRelativeV1> + DataProvider<DecimalSymbolsV1> + DataProvider<DecimalDigitsV1> + ?Sized,
pub fn try_new_short_quarter_unstable<D>(
provider: &D,
prefs: RelativeTimeFormatterPreferences,
options: RelativeTimeFormatterOptions,
) -> Result<Self, DataError>where
D: DataProvider<PluralsCardinalV1> + DataProvider<ShortQuarterRelativeV1> + DataProvider<DecimalSymbolsV1> + DataProvider<DecimalDigitsV1> + ?Sized,
A version of [Self :: try_new_short_quarter
] that uses custom data provided by a DataProvider
.
Sourcepub fn try_new_short_year(
prefs: RelativeTimeFormatterPreferences,
options: RelativeTimeFormatterOptions,
) -> Result<Self, DataError>
pub fn try_new_short_year( prefs: RelativeTimeFormatterPreferences, options: RelativeTimeFormatterOptions, ) -> Result<Self, DataError>
Create a new RelativeTimeFormatter
from compiled data.
✨ Enabled with the compiled_data
Cargo feature.
Sourcepub fn try_new_short_year_with_buffer_provider(
provider: &(impl BufferProvider + ?Sized),
prefs: RelativeTimeFormatterPreferences,
options: RelativeTimeFormatterOptions,
) -> Result<Self, DataError>
pub fn try_new_short_year_with_buffer_provider( provider: &(impl BufferProvider + ?Sized), prefs: RelativeTimeFormatterPreferences, options: RelativeTimeFormatterOptions, ) -> Result<Self, DataError>
A version of [Self :: try_new_short_year
] that uses custom data provided by a BufferProvider
.
✨ Enabled with the serde
feature.
Sourcepub fn try_new_short_year_unstable<D>(
provider: &D,
prefs: RelativeTimeFormatterPreferences,
options: RelativeTimeFormatterOptions,
) -> Result<Self, DataError>where
D: DataProvider<PluralsCardinalV1> + DataProvider<ShortYearRelativeV1> + DataProvider<DecimalSymbolsV1> + DataProvider<DecimalDigitsV1> + ?Sized,
pub fn try_new_short_year_unstable<D>(
provider: &D,
prefs: RelativeTimeFormatterPreferences,
options: RelativeTimeFormatterOptions,
) -> Result<Self, DataError>where
D: DataProvider<PluralsCardinalV1> + DataProvider<ShortYearRelativeV1> + DataProvider<DecimalSymbolsV1> + DataProvider<DecimalDigitsV1> + ?Sized,
A version of [Self :: try_new_short_year
] that uses custom data provided by a DataProvider
.
Sourcepub fn try_new_narrow_second(
prefs: RelativeTimeFormatterPreferences,
options: RelativeTimeFormatterOptions,
) -> Result<Self, DataError>
pub fn try_new_narrow_second( prefs: RelativeTimeFormatterPreferences, options: RelativeTimeFormatterOptions, ) -> Result<Self, DataError>
Create a new RelativeTimeFormatter
from compiled data.
✨ Enabled with the compiled_data
Cargo feature.
Sourcepub fn try_new_narrow_second_with_buffer_provider(
provider: &(impl BufferProvider + ?Sized),
prefs: RelativeTimeFormatterPreferences,
options: RelativeTimeFormatterOptions,
) -> Result<Self, DataError>
pub fn try_new_narrow_second_with_buffer_provider( provider: &(impl BufferProvider + ?Sized), prefs: RelativeTimeFormatterPreferences, options: RelativeTimeFormatterOptions, ) -> Result<Self, DataError>
A version of [Self :: try_new_narrow_second
] that uses custom data provided by a BufferProvider
.
✨ Enabled with the serde
feature.
Sourcepub fn try_new_narrow_second_unstable<D>(
provider: &D,
prefs: RelativeTimeFormatterPreferences,
options: RelativeTimeFormatterOptions,
) -> Result<Self, DataError>where
D: DataProvider<PluralsCardinalV1> + DataProvider<NarrowSecondRelativeV1> + DataProvider<DecimalSymbolsV1> + DataProvider<DecimalDigitsV1> + ?Sized,
pub fn try_new_narrow_second_unstable<D>(
provider: &D,
prefs: RelativeTimeFormatterPreferences,
options: RelativeTimeFormatterOptions,
) -> Result<Self, DataError>where
D: DataProvider<PluralsCardinalV1> + DataProvider<NarrowSecondRelativeV1> + DataProvider<DecimalSymbolsV1> + DataProvider<DecimalDigitsV1> + ?Sized,
A version of [Self :: try_new_narrow_second
] that uses custom data provided by a DataProvider
.
Sourcepub fn try_new_narrow_minute(
prefs: RelativeTimeFormatterPreferences,
options: RelativeTimeFormatterOptions,
) -> Result<Self, DataError>
pub fn try_new_narrow_minute( prefs: RelativeTimeFormatterPreferences, options: RelativeTimeFormatterOptions, ) -> Result<Self, DataError>
Create a new RelativeTimeFormatter
from compiled data.
✨ Enabled with the compiled_data
Cargo feature.
Sourcepub fn try_new_narrow_minute_with_buffer_provider(
provider: &(impl BufferProvider + ?Sized),
prefs: RelativeTimeFormatterPreferences,
options: RelativeTimeFormatterOptions,
) -> Result<Self, DataError>
pub fn try_new_narrow_minute_with_buffer_provider( provider: &(impl BufferProvider + ?Sized), prefs: RelativeTimeFormatterPreferences, options: RelativeTimeFormatterOptions, ) -> Result<Self, DataError>
A version of [Self :: try_new_narrow_minute
] that uses custom data provided by a BufferProvider
.
✨ Enabled with the serde
feature.
Sourcepub fn try_new_narrow_minute_unstable<D>(
provider: &D,
prefs: RelativeTimeFormatterPreferences,
options: RelativeTimeFormatterOptions,
) -> Result<Self, DataError>where
D: DataProvider<PluralsCardinalV1> + DataProvider<NarrowMinuteRelativeV1> + DataProvider<DecimalSymbolsV1> + DataProvider<DecimalDigitsV1> + ?Sized,
pub fn try_new_narrow_minute_unstable<D>(
provider: &D,
prefs: RelativeTimeFormatterPreferences,
options: RelativeTimeFormatterOptions,
) -> Result<Self, DataError>where
D: DataProvider<PluralsCardinalV1> + DataProvider<NarrowMinuteRelativeV1> + DataProvider<DecimalSymbolsV1> + DataProvider<DecimalDigitsV1> + ?Sized,
A version of [Self :: try_new_narrow_minute
] that uses custom data provided by a DataProvider
.
Sourcepub fn try_new_narrow_hour(
prefs: RelativeTimeFormatterPreferences,
options: RelativeTimeFormatterOptions,
) -> Result<Self, DataError>
pub fn try_new_narrow_hour( prefs: RelativeTimeFormatterPreferences, options: RelativeTimeFormatterOptions, ) -> Result<Self, DataError>
Create a new RelativeTimeFormatter
from compiled data.
✨ Enabled with the compiled_data
Cargo feature.
Sourcepub fn try_new_narrow_hour_with_buffer_provider(
provider: &(impl BufferProvider + ?Sized),
prefs: RelativeTimeFormatterPreferences,
options: RelativeTimeFormatterOptions,
) -> Result<Self, DataError>
pub fn try_new_narrow_hour_with_buffer_provider( provider: &(impl BufferProvider + ?Sized), prefs: RelativeTimeFormatterPreferences, options: RelativeTimeFormatterOptions, ) -> Result<Self, DataError>
A version of [Self :: try_new_narrow_hour
] that uses custom data provided by a BufferProvider
.
✨ Enabled with the serde
feature.
Sourcepub fn try_new_narrow_hour_unstable<D>(
provider: &D,
prefs: RelativeTimeFormatterPreferences,
options: RelativeTimeFormatterOptions,
) -> Result<Self, DataError>where
D: DataProvider<PluralsCardinalV1> + DataProvider<NarrowHourRelativeV1> + DataProvider<DecimalSymbolsV1> + DataProvider<DecimalDigitsV1> + ?Sized,
pub fn try_new_narrow_hour_unstable<D>(
provider: &D,
prefs: RelativeTimeFormatterPreferences,
options: RelativeTimeFormatterOptions,
) -> Result<Self, DataError>where
D: DataProvider<PluralsCardinalV1> + DataProvider<NarrowHourRelativeV1> + DataProvider<DecimalSymbolsV1> + DataProvider<DecimalDigitsV1> + ?Sized,
A version of [Self :: try_new_narrow_hour
] that uses custom data provided by a DataProvider
.
Sourcepub fn try_new_narrow_day(
prefs: RelativeTimeFormatterPreferences,
options: RelativeTimeFormatterOptions,
) -> Result<Self, DataError>
pub fn try_new_narrow_day( prefs: RelativeTimeFormatterPreferences, options: RelativeTimeFormatterOptions, ) -> Result<Self, DataError>
Create a new RelativeTimeFormatter
from compiled data.
✨ Enabled with the compiled_data
Cargo feature.
Sourcepub fn try_new_narrow_day_with_buffer_provider(
provider: &(impl BufferProvider + ?Sized),
prefs: RelativeTimeFormatterPreferences,
options: RelativeTimeFormatterOptions,
) -> Result<Self, DataError>
pub fn try_new_narrow_day_with_buffer_provider( provider: &(impl BufferProvider + ?Sized), prefs: RelativeTimeFormatterPreferences, options: RelativeTimeFormatterOptions, ) -> Result<Self, DataError>
A version of [Self :: try_new_narrow_day
] that uses custom data provided by a BufferProvider
.
✨ Enabled with the serde
feature.
Sourcepub fn try_new_narrow_day_unstable<D>(
provider: &D,
prefs: RelativeTimeFormatterPreferences,
options: RelativeTimeFormatterOptions,
) -> Result<Self, DataError>where
D: DataProvider<PluralsCardinalV1> + DataProvider<NarrowDayRelativeV1> + DataProvider<DecimalSymbolsV1> + DataProvider<DecimalDigitsV1> + ?Sized,
pub fn try_new_narrow_day_unstable<D>(
provider: &D,
prefs: RelativeTimeFormatterPreferences,
options: RelativeTimeFormatterOptions,
) -> Result<Self, DataError>where
D: DataProvider<PluralsCardinalV1> + DataProvider<NarrowDayRelativeV1> + DataProvider<DecimalSymbolsV1> + DataProvider<DecimalDigitsV1> + ?Sized,
A version of [Self :: try_new_narrow_day
] that uses custom data provided by a DataProvider
.
Sourcepub fn try_new_narrow_week(
prefs: RelativeTimeFormatterPreferences,
options: RelativeTimeFormatterOptions,
) -> Result<Self, DataError>
pub fn try_new_narrow_week( prefs: RelativeTimeFormatterPreferences, options: RelativeTimeFormatterOptions, ) -> Result<Self, DataError>
Create a new RelativeTimeFormatter
from compiled data.
✨ Enabled with the compiled_data
Cargo feature.
Sourcepub fn try_new_narrow_week_with_buffer_provider(
provider: &(impl BufferProvider + ?Sized),
prefs: RelativeTimeFormatterPreferences,
options: RelativeTimeFormatterOptions,
) -> Result<Self, DataError>
pub fn try_new_narrow_week_with_buffer_provider( provider: &(impl BufferProvider + ?Sized), prefs: RelativeTimeFormatterPreferences, options: RelativeTimeFormatterOptions, ) -> Result<Self, DataError>
A version of [Self :: try_new_narrow_week
] that uses custom data provided by a BufferProvider
.
✨ Enabled with the serde
feature.
Sourcepub fn try_new_narrow_week_unstable<D>(
provider: &D,
prefs: RelativeTimeFormatterPreferences,
options: RelativeTimeFormatterOptions,
) -> Result<Self, DataError>where
D: DataProvider<PluralsCardinalV1> + DataProvider<NarrowWeekRelativeV1> + DataProvider<DecimalSymbolsV1> + DataProvider<DecimalDigitsV1> + ?Sized,
pub fn try_new_narrow_week_unstable<D>(
provider: &D,
prefs: RelativeTimeFormatterPreferences,
options: RelativeTimeFormatterOptions,
) -> Result<Self, DataError>where
D: DataProvider<PluralsCardinalV1> + DataProvider<NarrowWeekRelativeV1> + DataProvider<DecimalSymbolsV1> + DataProvider<DecimalDigitsV1> + ?Sized,
A version of [Self :: try_new_narrow_week
] that uses custom data provided by a DataProvider
.
Sourcepub fn try_new_narrow_month(
prefs: RelativeTimeFormatterPreferences,
options: RelativeTimeFormatterOptions,
) -> Result<Self, DataError>
pub fn try_new_narrow_month( prefs: RelativeTimeFormatterPreferences, options: RelativeTimeFormatterOptions, ) -> Result<Self, DataError>
Create a new RelativeTimeFormatter
from compiled data.
✨ Enabled with the compiled_data
Cargo feature.
Sourcepub fn try_new_narrow_month_with_buffer_provider(
provider: &(impl BufferProvider + ?Sized),
prefs: RelativeTimeFormatterPreferences,
options: RelativeTimeFormatterOptions,
) -> Result<Self, DataError>
pub fn try_new_narrow_month_with_buffer_provider( provider: &(impl BufferProvider + ?Sized), prefs: RelativeTimeFormatterPreferences, options: RelativeTimeFormatterOptions, ) -> Result<Self, DataError>
A version of [Self :: try_new_narrow_month
] that uses custom data provided by a BufferProvider
.
✨ Enabled with the serde
feature.
Sourcepub fn try_new_narrow_month_unstable<D>(
provider: &D,
prefs: RelativeTimeFormatterPreferences,
options: RelativeTimeFormatterOptions,
) -> Result<Self, DataError>where
D: DataProvider<PluralsCardinalV1> + DataProvider<NarrowMonthRelativeV1> + DataProvider<DecimalSymbolsV1> + DataProvider<DecimalDigitsV1> + ?Sized,
pub fn try_new_narrow_month_unstable<D>(
provider: &D,
prefs: RelativeTimeFormatterPreferences,
options: RelativeTimeFormatterOptions,
) -> Result<Self, DataError>where
D: DataProvider<PluralsCardinalV1> + DataProvider<NarrowMonthRelativeV1> + DataProvider<DecimalSymbolsV1> + DataProvider<DecimalDigitsV1> + ?Sized,
A version of [Self :: try_new_narrow_month
] that uses custom data provided by a DataProvider
.
Sourcepub fn try_new_narrow_quarter(
prefs: RelativeTimeFormatterPreferences,
options: RelativeTimeFormatterOptions,
) -> Result<Self, DataError>
pub fn try_new_narrow_quarter( prefs: RelativeTimeFormatterPreferences, options: RelativeTimeFormatterOptions, ) -> Result<Self, DataError>
Create a new RelativeTimeFormatter
from compiled data.
✨ Enabled with the compiled_data
Cargo feature.
Sourcepub fn try_new_narrow_quarter_with_buffer_provider(
provider: &(impl BufferProvider + ?Sized),
prefs: RelativeTimeFormatterPreferences,
options: RelativeTimeFormatterOptions,
) -> Result<Self, DataError>
pub fn try_new_narrow_quarter_with_buffer_provider( provider: &(impl BufferProvider + ?Sized), prefs: RelativeTimeFormatterPreferences, options: RelativeTimeFormatterOptions, ) -> Result<Self, DataError>
A version of [Self :: try_new_narrow_quarter
] that uses custom data provided by a BufferProvider
.
✨ Enabled with the serde
feature.
Sourcepub fn try_new_narrow_quarter_unstable<D>(
provider: &D,
prefs: RelativeTimeFormatterPreferences,
options: RelativeTimeFormatterOptions,
) -> Result<Self, DataError>where
D: DataProvider<PluralsCardinalV1> + DataProvider<NarrowQuarterRelativeV1> + DataProvider<DecimalSymbolsV1> + DataProvider<DecimalDigitsV1> + ?Sized,
pub fn try_new_narrow_quarter_unstable<D>(
provider: &D,
prefs: RelativeTimeFormatterPreferences,
options: RelativeTimeFormatterOptions,
) -> Result<Self, DataError>where
D: DataProvider<PluralsCardinalV1> + DataProvider<NarrowQuarterRelativeV1> + DataProvider<DecimalSymbolsV1> + DataProvider<DecimalDigitsV1> + ?Sized,
A version of [Self :: try_new_narrow_quarter
] that uses custom data provided by a DataProvider
.
Sourcepub fn try_new_narrow_year(
prefs: RelativeTimeFormatterPreferences,
options: RelativeTimeFormatterOptions,
) -> Result<Self, DataError>
pub fn try_new_narrow_year( prefs: RelativeTimeFormatterPreferences, options: RelativeTimeFormatterOptions, ) -> Result<Self, DataError>
Create a new RelativeTimeFormatter
from compiled data.
✨ Enabled with the compiled_data
Cargo feature.
Sourcepub fn try_new_narrow_year_with_buffer_provider(
provider: &(impl BufferProvider + ?Sized),
prefs: RelativeTimeFormatterPreferences,
options: RelativeTimeFormatterOptions,
) -> Result<Self, DataError>
pub fn try_new_narrow_year_with_buffer_provider( provider: &(impl BufferProvider + ?Sized), prefs: RelativeTimeFormatterPreferences, options: RelativeTimeFormatterOptions, ) -> Result<Self, DataError>
A version of [Self :: try_new_narrow_year
] that uses custom data provided by a BufferProvider
.
✨ Enabled with the serde
feature.
Sourcepub fn try_new_narrow_year_unstable<D>(
provider: &D,
prefs: RelativeTimeFormatterPreferences,
options: RelativeTimeFormatterOptions,
) -> Result<Self, DataError>where
D: DataProvider<PluralsCardinalV1> + DataProvider<NarrowYearRelativeV1> + DataProvider<DecimalSymbolsV1> + DataProvider<DecimalDigitsV1> + ?Sized,
pub fn try_new_narrow_year_unstable<D>(
provider: &D,
prefs: RelativeTimeFormatterPreferences,
options: RelativeTimeFormatterOptions,
) -> Result<Self, DataError>where
D: DataProvider<PluralsCardinalV1> + DataProvider<NarrowYearRelativeV1> + DataProvider<DecimalSymbolsV1> + DataProvider<DecimalDigitsV1> + ?Sized,
A version of [Self :: try_new_narrow_year
] that uses custom data provided by a DataProvider
.
Sourcepub fn format(&self, value: Decimal) -> FormattedRelativeTime<'_>
pub fn format(&self, value: Decimal) -> FormattedRelativeTime<'_>
Format a value
according to the locale and formatting options of
RelativeTimeFormatter
.
Auto Trait Implementations§
impl Freeze for RelativeTimeFormatter
impl RefUnwindSafe for RelativeTimeFormatter
impl Send for RelativeTimeFormatter
impl Sync for RelativeTimeFormatter
impl Unpin for RelativeTimeFormatter
impl UnwindSafe for RelativeTimeFormatter
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more