Struct icu::experimental::relativetime::RelativeTimeFormatter
source · pub struct RelativeTimeFormatter { /* private fields */ }
Expand description
A formatter to render locale-sensitive relative time.
§Example
use fixed_decimal::FixedDecimal;
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(FixedDecimal::from(5i8)),
"in 5 seconds"
);
assert_writeable_eq!(
relative_time_formatter.format(FixedDecimal::from(-10i8)),
"10 seconds ago"
);
§Example
use fixed_decimal::FixedDecimal;
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(FixedDecimal::from(0u8)),
"hoy"
);
assert_writeable_eq!(
relative_time_formatter.format(FixedDecimal::from(-2i8)),
"anteayer"
);
assert_writeable_eq!(
relative_time_formatter.format(FixedDecimal::from(2u8)),
"pasado mañana"
);
assert_writeable_eq!(
relative_time_formatter.format(FixedDecimal::from(15i8)),
"dentro de 15 d"
);
§Example
use fixed_decimal::FixedDecimal;
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(FixedDecimal::from(3u8)),
"৩ বছরে"
);
assert_writeable_eq!(
relative_time_formatter.format(FixedDecimal::from(-15i8)),
"১৫ বছর পূর্বে"
);
Implementations§
source§impl RelativeTimeFormatter
impl RelativeTimeFormatter
sourcepub fn try_new_long_second(
locale: &DataLocale,
options: RelativeTimeFormatterOptions,
) -> Result<RelativeTimeFormatter, DataError>
pub fn try_new_long_second( locale: &DataLocale, options: RelativeTimeFormatterOptions, ) -> Result<RelativeTimeFormatter, DataError>
Create a new RelativeTimeFormatter
from compiled data.
✨ Enabled with the compiled_data
Cargo feature.
sourcepub fn try_new_long_second_with_any_provider(
provider: &(impl AnyProvider + ?Sized),
locale: &DataLocale,
options: RelativeTimeFormatterOptions,
) -> Result<RelativeTimeFormatter, DataError>
pub fn try_new_long_second_with_any_provider( provider: &(impl AnyProvider + ?Sized), locale: &DataLocale, options: RelativeTimeFormatterOptions, ) -> Result<RelativeTimeFormatter, DataError>
A version of [Self :: try_new_long_second
] that uses custom data provided by an AnyProvider
.
sourcepub fn try_new_long_second_with_buffer_provider(
provider: &(impl BufferProvider + ?Sized),
locale: &DataLocale,
options: RelativeTimeFormatterOptions,
) -> Result<RelativeTimeFormatter, DataError>
pub fn try_new_long_second_with_buffer_provider( provider: &(impl BufferProvider + ?Sized), locale: &DataLocale, options: RelativeTimeFormatterOptions, ) -> Result<RelativeTimeFormatter, 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,
locale: &DataLocale,
options: RelativeTimeFormatterOptions,
) -> Result<RelativeTimeFormatter, DataError>
pub fn try_new_long_second_unstable<D>( provider: &D, locale: &DataLocale, options: RelativeTimeFormatterOptions, ) -> Result<RelativeTimeFormatter, DataError>
A version of [Self :: try_new_long_second
] that uses custom data provided by a DataProvider
.
sourcepub fn try_new_long_minute(
locale: &DataLocale,
options: RelativeTimeFormatterOptions,
) -> Result<RelativeTimeFormatter, DataError>
pub fn try_new_long_minute( locale: &DataLocale, options: RelativeTimeFormatterOptions, ) -> Result<RelativeTimeFormatter, DataError>
Create a new RelativeTimeFormatter
from compiled data.
✨ Enabled with the compiled_data
Cargo feature.
sourcepub fn try_new_long_minute_with_any_provider(
provider: &(impl AnyProvider + ?Sized),
locale: &DataLocale,
options: RelativeTimeFormatterOptions,
) -> Result<RelativeTimeFormatter, DataError>
pub fn try_new_long_minute_with_any_provider( provider: &(impl AnyProvider + ?Sized), locale: &DataLocale, options: RelativeTimeFormatterOptions, ) -> Result<RelativeTimeFormatter, DataError>
A version of [Self :: try_new_long_minute
] that uses custom data provided by an AnyProvider
.
sourcepub fn try_new_long_minute_with_buffer_provider(
provider: &(impl BufferProvider + ?Sized),
locale: &DataLocale,
options: RelativeTimeFormatterOptions,
) -> Result<RelativeTimeFormatter, DataError>
pub fn try_new_long_minute_with_buffer_provider( provider: &(impl BufferProvider + ?Sized), locale: &DataLocale, options: RelativeTimeFormatterOptions, ) -> Result<RelativeTimeFormatter, 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,
locale: &DataLocale,
options: RelativeTimeFormatterOptions,
) -> Result<RelativeTimeFormatter, DataError>
pub fn try_new_long_minute_unstable<D>( provider: &D, locale: &DataLocale, options: RelativeTimeFormatterOptions, ) -> Result<RelativeTimeFormatter, DataError>
A version of [Self :: try_new_long_minute
] that uses custom data provided by a DataProvider
.
sourcepub fn try_new_long_hour(
locale: &DataLocale,
options: RelativeTimeFormatterOptions,
) -> Result<RelativeTimeFormatter, DataError>
pub fn try_new_long_hour( locale: &DataLocale, options: RelativeTimeFormatterOptions, ) -> Result<RelativeTimeFormatter, DataError>
Create a new RelativeTimeFormatter
from compiled data.
✨ Enabled with the compiled_data
Cargo feature.
sourcepub fn try_new_long_hour_with_any_provider(
provider: &(impl AnyProvider + ?Sized),
locale: &DataLocale,
options: RelativeTimeFormatterOptions,
) -> Result<RelativeTimeFormatter, DataError>
pub fn try_new_long_hour_with_any_provider( provider: &(impl AnyProvider + ?Sized), locale: &DataLocale, options: RelativeTimeFormatterOptions, ) -> Result<RelativeTimeFormatter, DataError>
A version of [Self :: try_new_long_hour
] that uses custom data provided by an AnyProvider
.
sourcepub fn try_new_long_hour_with_buffer_provider(
provider: &(impl BufferProvider + ?Sized),
locale: &DataLocale,
options: RelativeTimeFormatterOptions,
) -> Result<RelativeTimeFormatter, DataError>
pub fn try_new_long_hour_with_buffer_provider( provider: &(impl BufferProvider + ?Sized), locale: &DataLocale, options: RelativeTimeFormatterOptions, ) -> Result<RelativeTimeFormatter, 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,
locale: &DataLocale,
options: RelativeTimeFormatterOptions,
) -> Result<RelativeTimeFormatter, DataError>
pub fn try_new_long_hour_unstable<D>( provider: &D, locale: &DataLocale, options: RelativeTimeFormatterOptions, ) -> Result<RelativeTimeFormatter, DataError>
A version of [Self :: try_new_long_hour
] that uses custom data provided by a DataProvider
.
sourcepub fn try_new_long_day(
locale: &DataLocale,
options: RelativeTimeFormatterOptions,
) -> Result<RelativeTimeFormatter, DataError>
pub fn try_new_long_day( locale: &DataLocale, options: RelativeTimeFormatterOptions, ) -> Result<RelativeTimeFormatter, DataError>
Create a new RelativeTimeFormatter
from compiled data.
✨ Enabled with the compiled_data
Cargo feature.
sourcepub fn try_new_long_day_with_any_provider(
provider: &(impl AnyProvider + ?Sized),
locale: &DataLocale,
options: RelativeTimeFormatterOptions,
) -> Result<RelativeTimeFormatter, DataError>
pub fn try_new_long_day_with_any_provider( provider: &(impl AnyProvider + ?Sized), locale: &DataLocale, options: RelativeTimeFormatterOptions, ) -> Result<RelativeTimeFormatter, DataError>
A version of [Self :: try_new_long_day
] that uses custom data provided by an AnyProvider
.
sourcepub fn try_new_long_day_with_buffer_provider(
provider: &(impl BufferProvider + ?Sized),
locale: &DataLocale,
options: RelativeTimeFormatterOptions,
) -> Result<RelativeTimeFormatter, DataError>
pub fn try_new_long_day_with_buffer_provider( provider: &(impl BufferProvider + ?Sized), locale: &DataLocale, options: RelativeTimeFormatterOptions, ) -> Result<RelativeTimeFormatter, 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,
locale: &DataLocale,
options: RelativeTimeFormatterOptions,
) -> Result<RelativeTimeFormatter, DataError>
pub fn try_new_long_day_unstable<D>( provider: &D, locale: &DataLocale, options: RelativeTimeFormatterOptions, ) -> Result<RelativeTimeFormatter, DataError>
A version of [Self :: try_new_long_day
] that uses custom data provided by a DataProvider
.
sourcepub fn try_new_long_week(
locale: &DataLocale,
options: RelativeTimeFormatterOptions,
) -> Result<RelativeTimeFormatter, DataError>
pub fn try_new_long_week( locale: &DataLocale, options: RelativeTimeFormatterOptions, ) -> Result<RelativeTimeFormatter, DataError>
Create a new RelativeTimeFormatter
from compiled data.
✨ Enabled with the compiled_data
Cargo feature.
sourcepub fn try_new_long_week_with_any_provider(
provider: &(impl AnyProvider + ?Sized),
locale: &DataLocale,
options: RelativeTimeFormatterOptions,
) -> Result<RelativeTimeFormatter, DataError>
pub fn try_new_long_week_with_any_provider( provider: &(impl AnyProvider + ?Sized), locale: &DataLocale, options: RelativeTimeFormatterOptions, ) -> Result<RelativeTimeFormatter, DataError>
A version of [Self :: try_new_long_week
] that uses custom data provided by an AnyProvider
.
sourcepub fn try_new_long_week_with_buffer_provider(
provider: &(impl BufferProvider + ?Sized),
locale: &DataLocale,
options: RelativeTimeFormatterOptions,
) -> Result<RelativeTimeFormatter, DataError>
pub fn try_new_long_week_with_buffer_provider( provider: &(impl BufferProvider + ?Sized), locale: &DataLocale, options: RelativeTimeFormatterOptions, ) -> Result<RelativeTimeFormatter, 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,
locale: &DataLocale,
options: RelativeTimeFormatterOptions,
) -> Result<RelativeTimeFormatter, DataError>
pub fn try_new_long_week_unstable<D>( provider: &D, locale: &DataLocale, options: RelativeTimeFormatterOptions, ) -> Result<RelativeTimeFormatter, DataError>
A version of [Self :: try_new_long_week
] that uses custom data provided by a DataProvider
.
sourcepub fn try_new_long_month(
locale: &DataLocale,
options: RelativeTimeFormatterOptions,
) -> Result<RelativeTimeFormatter, DataError>
pub fn try_new_long_month( locale: &DataLocale, options: RelativeTimeFormatterOptions, ) -> Result<RelativeTimeFormatter, DataError>
Create a new RelativeTimeFormatter
from compiled data.
✨ Enabled with the compiled_data
Cargo feature.
sourcepub fn try_new_long_month_with_any_provider(
provider: &(impl AnyProvider + ?Sized),
locale: &DataLocale,
options: RelativeTimeFormatterOptions,
) -> Result<RelativeTimeFormatter, DataError>
pub fn try_new_long_month_with_any_provider( provider: &(impl AnyProvider + ?Sized), locale: &DataLocale, options: RelativeTimeFormatterOptions, ) -> Result<RelativeTimeFormatter, DataError>
A version of [Self :: try_new_long_month
] that uses custom data provided by an AnyProvider
.
sourcepub fn try_new_long_month_with_buffer_provider(
provider: &(impl BufferProvider + ?Sized),
locale: &DataLocale,
options: RelativeTimeFormatterOptions,
) -> Result<RelativeTimeFormatter, DataError>
pub fn try_new_long_month_with_buffer_provider( provider: &(impl BufferProvider + ?Sized), locale: &DataLocale, options: RelativeTimeFormatterOptions, ) -> Result<RelativeTimeFormatter, 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,
locale: &DataLocale,
options: RelativeTimeFormatterOptions,
) -> Result<RelativeTimeFormatter, DataError>
pub fn try_new_long_month_unstable<D>( provider: &D, locale: &DataLocale, options: RelativeTimeFormatterOptions, ) -> Result<RelativeTimeFormatter, DataError>
A version of [Self :: try_new_long_month
] that uses custom data provided by a DataProvider
.
sourcepub fn try_new_long_quarter(
locale: &DataLocale,
options: RelativeTimeFormatterOptions,
) -> Result<RelativeTimeFormatter, DataError>
pub fn try_new_long_quarter( locale: &DataLocale, options: RelativeTimeFormatterOptions, ) -> Result<RelativeTimeFormatter, DataError>
Create a new RelativeTimeFormatter
from compiled data.
✨ Enabled with the compiled_data
Cargo feature.
sourcepub fn try_new_long_quarter_with_any_provider(
provider: &(impl AnyProvider + ?Sized),
locale: &DataLocale,
options: RelativeTimeFormatterOptions,
) -> Result<RelativeTimeFormatter, DataError>
pub fn try_new_long_quarter_with_any_provider( provider: &(impl AnyProvider + ?Sized), locale: &DataLocale, options: RelativeTimeFormatterOptions, ) -> Result<RelativeTimeFormatter, DataError>
A version of [Self :: try_new_long_quarter
] that uses custom data provided by an AnyProvider
.
sourcepub fn try_new_long_quarter_with_buffer_provider(
provider: &(impl BufferProvider + ?Sized),
locale: &DataLocale,
options: RelativeTimeFormatterOptions,
) -> Result<RelativeTimeFormatter, DataError>
pub fn try_new_long_quarter_with_buffer_provider( provider: &(impl BufferProvider + ?Sized), locale: &DataLocale, options: RelativeTimeFormatterOptions, ) -> Result<RelativeTimeFormatter, 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,
locale: &DataLocale,
options: RelativeTimeFormatterOptions,
) -> Result<RelativeTimeFormatter, DataError>
pub fn try_new_long_quarter_unstable<D>( provider: &D, locale: &DataLocale, options: RelativeTimeFormatterOptions, ) -> Result<RelativeTimeFormatter, DataError>
A version of [Self :: try_new_long_quarter
] that uses custom data provided by a DataProvider
.
sourcepub fn try_new_long_year(
locale: &DataLocale,
options: RelativeTimeFormatterOptions,
) -> Result<RelativeTimeFormatter, DataError>
pub fn try_new_long_year( locale: &DataLocale, options: RelativeTimeFormatterOptions, ) -> Result<RelativeTimeFormatter, DataError>
Create a new RelativeTimeFormatter
from compiled data.
✨ Enabled with the compiled_data
Cargo feature.
sourcepub fn try_new_long_year_with_any_provider(
provider: &(impl AnyProvider + ?Sized),
locale: &DataLocale,
options: RelativeTimeFormatterOptions,
) -> Result<RelativeTimeFormatter, DataError>
pub fn try_new_long_year_with_any_provider( provider: &(impl AnyProvider + ?Sized), locale: &DataLocale, options: RelativeTimeFormatterOptions, ) -> Result<RelativeTimeFormatter, DataError>
A version of [Self :: try_new_long_year
] that uses custom data provided by an AnyProvider
.
sourcepub fn try_new_long_year_with_buffer_provider(
provider: &(impl BufferProvider + ?Sized),
locale: &DataLocale,
options: RelativeTimeFormatterOptions,
) -> Result<RelativeTimeFormatter, DataError>
pub fn try_new_long_year_with_buffer_provider( provider: &(impl BufferProvider + ?Sized), locale: &DataLocale, options: RelativeTimeFormatterOptions, ) -> Result<RelativeTimeFormatter, 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,
locale: &DataLocale,
options: RelativeTimeFormatterOptions,
) -> Result<RelativeTimeFormatter, DataError>
pub fn try_new_long_year_unstable<D>( provider: &D, locale: &DataLocale, options: RelativeTimeFormatterOptions, ) -> Result<RelativeTimeFormatter, DataError>
A version of [Self :: try_new_long_year
] that uses custom data provided by a DataProvider
.
sourcepub fn try_new_short_second(
locale: &DataLocale,
options: RelativeTimeFormatterOptions,
) -> Result<RelativeTimeFormatter, DataError>
pub fn try_new_short_second( locale: &DataLocale, options: RelativeTimeFormatterOptions, ) -> Result<RelativeTimeFormatter, DataError>
Create a new RelativeTimeFormatter
from compiled data.
✨ Enabled with the compiled_data
Cargo feature.
sourcepub fn try_new_short_second_with_any_provider(
provider: &(impl AnyProvider + ?Sized),
locale: &DataLocale,
options: RelativeTimeFormatterOptions,
) -> Result<RelativeTimeFormatter, DataError>
pub fn try_new_short_second_with_any_provider( provider: &(impl AnyProvider + ?Sized), locale: &DataLocale, options: RelativeTimeFormatterOptions, ) -> Result<RelativeTimeFormatter, DataError>
A version of [Self :: try_new_short_second
] that uses custom data provided by an AnyProvider
.
sourcepub fn try_new_short_second_with_buffer_provider(
provider: &(impl BufferProvider + ?Sized),
locale: &DataLocale,
options: RelativeTimeFormatterOptions,
) -> Result<RelativeTimeFormatter, DataError>
pub fn try_new_short_second_with_buffer_provider( provider: &(impl BufferProvider + ?Sized), locale: &DataLocale, options: RelativeTimeFormatterOptions, ) -> Result<RelativeTimeFormatter, 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,
locale: &DataLocale,
options: RelativeTimeFormatterOptions,
) -> Result<RelativeTimeFormatter, DataError>
pub fn try_new_short_second_unstable<D>( provider: &D, locale: &DataLocale, options: RelativeTimeFormatterOptions, ) -> Result<RelativeTimeFormatter, DataError>
A version of [Self :: try_new_short_second
] that uses custom data provided by a DataProvider
.
sourcepub fn try_new_short_minute(
locale: &DataLocale,
options: RelativeTimeFormatterOptions,
) -> Result<RelativeTimeFormatter, DataError>
pub fn try_new_short_minute( locale: &DataLocale, options: RelativeTimeFormatterOptions, ) -> Result<RelativeTimeFormatter, DataError>
Create a new RelativeTimeFormatter
from compiled data.
✨ Enabled with the compiled_data
Cargo feature.
sourcepub fn try_new_short_minute_with_any_provider(
provider: &(impl AnyProvider + ?Sized),
locale: &DataLocale,
options: RelativeTimeFormatterOptions,
) -> Result<RelativeTimeFormatter, DataError>
pub fn try_new_short_minute_with_any_provider( provider: &(impl AnyProvider + ?Sized), locale: &DataLocale, options: RelativeTimeFormatterOptions, ) -> Result<RelativeTimeFormatter, DataError>
A version of [Self :: try_new_short_minute
] that uses custom data provided by an AnyProvider
.
sourcepub fn try_new_short_minute_with_buffer_provider(
provider: &(impl BufferProvider + ?Sized),
locale: &DataLocale,
options: RelativeTimeFormatterOptions,
) -> Result<RelativeTimeFormatter, DataError>
pub fn try_new_short_minute_with_buffer_provider( provider: &(impl BufferProvider + ?Sized), locale: &DataLocale, options: RelativeTimeFormatterOptions, ) -> Result<RelativeTimeFormatter, 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,
locale: &DataLocale,
options: RelativeTimeFormatterOptions,
) -> Result<RelativeTimeFormatter, DataError>
pub fn try_new_short_minute_unstable<D>( provider: &D, locale: &DataLocale, options: RelativeTimeFormatterOptions, ) -> Result<RelativeTimeFormatter, DataError>
A version of [Self :: try_new_short_minute
] that uses custom data provided by a DataProvider
.
sourcepub fn try_new_short_hour(
locale: &DataLocale,
options: RelativeTimeFormatterOptions,
) -> Result<RelativeTimeFormatter, DataError>
pub fn try_new_short_hour( locale: &DataLocale, options: RelativeTimeFormatterOptions, ) -> Result<RelativeTimeFormatter, DataError>
Create a new RelativeTimeFormatter
from compiled data.
✨ Enabled with the compiled_data
Cargo feature.
sourcepub fn try_new_short_hour_with_any_provider(
provider: &(impl AnyProvider + ?Sized),
locale: &DataLocale,
options: RelativeTimeFormatterOptions,
) -> Result<RelativeTimeFormatter, DataError>
pub fn try_new_short_hour_with_any_provider( provider: &(impl AnyProvider + ?Sized), locale: &DataLocale, options: RelativeTimeFormatterOptions, ) -> Result<RelativeTimeFormatter, DataError>
A version of [Self :: try_new_short_hour
] that uses custom data provided by an AnyProvider
.
sourcepub fn try_new_short_hour_with_buffer_provider(
provider: &(impl BufferProvider + ?Sized),
locale: &DataLocale,
options: RelativeTimeFormatterOptions,
) -> Result<RelativeTimeFormatter, DataError>
pub fn try_new_short_hour_with_buffer_provider( provider: &(impl BufferProvider + ?Sized), locale: &DataLocale, options: RelativeTimeFormatterOptions, ) -> Result<RelativeTimeFormatter, 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,
locale: &DataLocale,
options: RelativeTimeFormatterOptions,
) -> Result<RelativeTimeFormatter, DataError>
pub fn try_new_short_hour_unstable<D>( provider: &D, locale: &DataLocale, options: RelativeTimeFormatterOptions, ) -> Result<RelativeTimeFormatter, DataError>
A version of [Self :: try_new_short_hour
] that uses custom data provided by a DataProvider
.
sourcepub fn try_new_short_day(
locale: &DataLocale,
options: RelativeTimeFormatterOptions,
) -> Result<RelativeTimeFormatter, DataError>
pub fn try_new_short_day( locale: &DataLocale, options: RelativeTimeFormatterOptions, ) -> Result<RelativeTimeFormatter, DataError>
Create a new RelativeTimeFormatter
from compiled data.
✨ Enabled with the compiled_data
Cargo feature.
sourcepub fn try_new_short_day_with_any_provider(
provider: &(impl AnyProvider + ?Sized),
locale: &DataLocale,
options: RelativeTimeFormatterOptions,
) -> Result<RelativeTimeFormatter, DataError>
pub fn try_new_short_day_with_any_provider( provider: &(impl AnyProvider + ?Sized), locale: &DataLocale, options: RelativeTimeFormatterOptions, ) -> Result<RelativeTimeFormatter, DataError>
A version of [Self :: try_new_short_day
] that uses custom data provided by an AnyProvider
.
sourcepub fn try_new_short_day_with_buffer_provider(
provider: &(impl BufferProvider + ?Sized),
locale: &DataLocale,
options: RelativeTimeFormatterOptions,
) -> Result<RelativeTimeFormatter, DataError>
pub fn try_new_short_day_with_buffer_provider( provider: &(impl BufferProvider + ?Sized), locale: &DataLocale, options: RelativeTimeFormatterOptions, ) -> Result<RelativeTimeFormatter, 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,
locale: &DataLocale,
options: RelativeTimeFormatterOptions,
) -> Result<RelativeTimeFormatter, DataError>
pub fn try_new_short_day_unstable<D>( provider: &D, locale: &DataLocale, options: RelativeTimeFormatterOptions, ) -> Result<RelativeTimeFormatter, DataError>
A version of [Self :: try_new_short_day
] that uses custom data provided by a DataProvider
.
sourcepub fn try_new_short_week(
locale: &DataLocale,
options: RelativeTimeFormatterOptions,
) -> Result<RelativeTimeFormatter, DataError>
pub fn try_new_short_week( locale: &DataLocale, options: RelativeTimeFormatterOptions, ) -> Result<RelativeTimeFormatter, DataError>
Create a new RelativeTimeFormatter
from compiled data.
✨ Enabled with the compiled_data
Cargo feature.
sourcepub fn try_new_short_week_with_any_provider(
provider: &(impl AnyProvider + ?Sized),
locale: &DataLocale,
options: RelativeTimeFormatterOptions,
) -> Result<RelativeTimeFormatter, DataError>
pub fn try_new_short_week_with_any_provider( provider: &(impl AnyProvider + ?Sized), locale: &DataLocale, options: RelativeTimeFormatterOptions, ) -> Result<RelativeTimeFormatter, DataError>
A version of [Self :: try_new_short_week
] that uses custom data provided by an AnyProvider
.
sourcepub fn try_new_short_week_with_buffer_provider(
provider: &(impl BufferProvider + ?Sized),
locale: &DataLocale,
options: RelativeTimeFormatterOptions,
) -> Result<RelativeTimeFormatter, DataError>
pub fn try_new_short_week_with_buffer_provider( provider: &(impl BufferProvider + ?Sized), locale: &DataLocale, options: RelativeTimeFormatterOptions, ) -> Result<RelativeTimeFormatter, 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,
locale: &DataLocale,
options: RelativeTimeFormatterOptions,
) -> Result<RelativeTimeFormatter, DataError>
pub fn try_new_short_week_unstable<D>( provider: &D, locale: &DataLocale, options: RelativeTimeFormatterOptions, ) -> Result<RelativeTimeFormatter, DataError>
A version of [Self :: try_new_short_week
] that uses custom data provided by a DataProvider
.
sourcepub fn try_new_short_month(
locale: &DataLocale,
options: RelativeTimeFormatterOptions,
) -> Result<RelativeTimeFormatter, DataError>
pub fn try_new_short_month( locale: &DataLocale, options: RelativeTimeFormatterOptions, ) -> Result<RelativeTimeFormatter, DataError>
Create a new RelativeTimeFormatter
from compiled data.
✨ Enabled with the compiled_data
Cargo feature.
sourcepub fn try_new_short_month_with_any_provider(
provider: &(impl AnyProvider + ?Sized),
locale: &DataLocale,
options: RelativeTimeFormatterOptions,
) -> Result<RelativeTimeFormatter, DataError>
pub fn try_new_short_month_with_any_provider( provider: &(impl AnyProvider + ?Sized), locale: &DataLocale, options: RelativeTimeFormatterOptions, ) -> Result<RelativeTimeFormatter, DataError>
A version of [Self :: try_new_short_month
] that uses custom data provided by an AnyProvider
.
sourcepub fn try_new_short_month_with_buffer_provider(
provider: &(impl BufferProvider + ?Sized),
locale: &DataLocale,
options: RelativeTimeFormatterOptions,
) -> Result<RelativeTimeFormatter, DataError>
pub fn try_new_short_month_with_buffer_provider( provider: &(impl BufferProvider + ?Sized), locale: &DataLocale, options: RelativeTimeFormatterOptions, ) -> Result<RelativeTimeFormatter, 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,
locale: &DataLocale,
options: RelativeTimeFormatterOptions,
) -> Result<RelativeTimeFormatter, DataError>
pub fn try_new_short_month_unstable<D>( provider: &D, locale: &DataLocale, options: RelativeTimeFormatterOptions, ) -> Result<RelativeTimeFormatter, DataError>
A version of [Self :: try_new_short_month
] that uses custom data provided by a DataProvider
.
sourcepub fn try_new_short_quarter(
locale: &DataLocale,
options: RelativeTimeFormatterOptions,
) -> Result<RelativeTimeFormatter, DataError>
pub fn try_new_short_quarter( locale: &DataLocale, options: RelativeTimeFormatterOptions, ) -> Result<RelativeTimeFormatter, DataError>
Create a new RelativeTimeFormatter
from compiled data.
✨ Enabled with the compiled_data
Cargo feature.
sourcepub fn try_new_short_quarter_with_any_provider(
provider: &(impl AnyProvider + ?Sized),
locale: &DataLocale,
options: RelativeTimeFormatterOptions,
) -> Result<RelativeTimeFormatter, DataError>
pub fn try_new_short_quarter_with_any_provider( provider: &(impl AnyProvider + ?Sized), locale: &DataLocale, options: RelativeTimeFormatterOptions, ) -> Result<RelativeTimeFormatter, DataError>
A version of [Self :: try_new_short_quarter
] that uses custom data provided by an AnyProvider
.
sourcepub fn try_new_short_quarter_with_buffer_provider(
provider: &(impl BufferProvider + ?Sized),
locale: &DataLocale,
options: RelativeTimeFormatterOptions,
) -> Result<RelativeTimeFormatter, DataError>
pub fn try_new_short_quarter_with_buffer_provider( provider: &(impl BufferProvider + ?Sized), locale: &DataLocale, options: RelativeTimeFormatterOptions, ) -> Result<RelativeTimeFormatter, 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,
locale: &DataLocale,
options: RelativeTimeFormatterOptions,
) -> Result<RelativeTimeFormatter, DataError>
pub fn try_new_short_quarter_unstable<D>( provider: &D, locale: &DataLocale, options: RelativeTimeFormatterOptions, ) -> Result<RelativeTimeFormatter, DataError>
A version of [Self :: try_new_short_quarter
] that uses custom data provided by a DataProvider
.
sourcepub fn try_new_short_year(
locale: &DataLocale,
options: RelativeTimeFormatterOptions,
) -> Result<RelativeTimeFormatter, DataError>
pub fn try_new_short_year( locale: &DataLocale, options: RelativeTimeFormatterOptions, ) -> Result<RelativeTimeFormatter, DataError>
Create a new RelativeTimeFormatter
from compiled data.
✨ Enabled with the compiled_data
Cargo feature.
sourcepub fn try_new_short_year_with_any_provider(
provider: &(impl AnyProvider + ?Sized),
locale: &DataLocale,
options: RelativeTimeFormatterOptions,
) -> Result<RelativeTimeFormatter, DataError>
pub fn try_new_short_year_with_any_provider( provider: &(impl AnyProvider + ?Sized), locale: &DataLocale, options: RelativeTimeFormatterOptions, ) -> Result<RelativeTimeFormatter, DataError>
A version of [Self :: try_new_short_year
] that uses custom data provided by an AnyProvider
.
sourcepub fn try_new_short_year_with_buffer_provider(
provider: &(impl BufferProvider + ?Sized),
locale: &DataLocale,
options: RelativeTimeFormatterOptions,
) -> Result<RelativeTimeFormatter, DataError>
pub fn try_new_short_year_with_buffer_provider( provider: &(impl BufferProvider + ?Sized), locale: &DataLocale, options: RelativeTimeFormatterOptions, ) -> Result<RelativeTimeFormatter, 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,
locale: &DataLocale,
options: RelativeTimeFormatterOptions,
) -> Result<RelativeTimeFormatter, DataError>
pub fn try_new_short_year_unstable<D>( provider: &D, locale: &DataLocale, options: RelativeTimeFormatterOptions, ) -> Result<RelativeTimeFormatter, DataError>
A version of [Self :: try_new_short_year
] that uses custom data provided by a DataProvider
.
sourcepub fn try_new_narrow_second(
locale: &DataLocale,
options: RelativeTimeFormatterOptions,
) -> Result<RelativeTimeFormatter, DataError>
pub fn try_new_narrow_second( locale: &DataLocale, options: RelativeTimeFormatterOptions, ) -> Result<RelativeTimeFormatter, DataError>
Create a new RelativeTimeFormatter
from compiled data.
✨ Enabled with the compiled_data
Cargo feature.
sourcepub fn try_new_narrow_second_with_any_provider(
provider: &(impl AnyProvider + ?Sized),
locale: &DataLocale,
options: RelativeTimeFormatterOptions,
) -> Result<RelativeTimeFormatter, DataError>
pub fn try_new_narrow_second_with_any_provider( provider: &(impl AnyProvider + ?Sized), locale: &DataLocale, options: RelativeTimeFormatterOptions, ) -> Result<RelativeTimeFormatter, DataError>
A version of [Self :: try_new_narrow_second
] that uses custom data provided by an AnyProvider
.
sourcepub fn try_new_narrow_second_with_buffer_provider(
provider: &(impl BufferProvider + ?Sized),
locale: &DataLocale,
options: RelativeTimeFormatterOptions,
) -> Result<RelativeTimeFormatter, DataError>
pub fn try_new_narrow_second_with_buffer_provider( provider: &(impl BufferProvider + ?Sized), locale: &DataLocale, options: RelativeTimeFormatterOptions, ) -> Result<RelativeTimeFormatter, 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,
locale: &DataLocale,
options: RelativeTimeFormatterOptions,
) -> Result<RelativeTimeFormatter, DataError>
pub fn try_new_narrow_second_unstable<D>( provider: &D, locale: &DataLocale, options: RelativeTimeFormatterOptions, ) -> Result<RelativeTimeFormatter, DataError>
A version of [Self :: try_new_narrow_second
] that uses custom data provided by a DataProvider
.
sourcepub fn try_new_narrow_minute(
locale: &DataLocale,
options: RelativeTimeFormatterOptions,
) -> Result<RelativeTimeFormatter, DataError>
pub fn try_new_narrow_minute( locale: &DataLocale, options: RelativeTimeFormatterOptions, ) -> Result<RelativeTimeFormatter, DataError>
Create a new RelativeTimeFormatter
from compiled data.
✨ Enabled with the compiled_data
Cargo feature.
sourcepub fn try_new_narrow_minute_with_any_provider(
provider: &(impl AnyProvider + ?Sized),
locale: &DataLocale,
options: RelativeTimeFormatterOptions,
) -> Result<RelativeTimeFormatter, DataError>
pub fn try_new_narrow_minute_with_any_provider( provider: &(impl AnyProvider + ?Sized), locale: &DataLocale, options: RelativeTimeFormatterOptions, ) -> Result<RelativeTimeFormatter, DataError>
A version of [Self :: try_new_narrow_minute
] that uses custom data provided by an AnyProvider
.
sourcepub fn try_new_narrow_minute_with_buffer_provider(
provider: &(impl BufferProvider + ?Sized),
locale: &DataLocale,
options: RelativeTimeFormatterOptions,
) -> Result<RelativeTimeFormatter, DataError>
pub fn try_new_narrow_minute_with_buffer_provider( provider: &(impl BufferProvider + ?Sized), locale: &DataLocale, options: RelativeTimeFormatterOptions, ) -> Result<RelativeTimeFormatter, 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,
locale: &DataLocale,
options: RelativeTimeFormatterOptions,
) -> Result<RelativeTimeFormatter, DataError>
pub fn try_new_narrow_minute_unstable<D>( provider: &D, locale: &DataLocale, options: RelativeTimeFormatterOptions, ) -> Result<RelativeTimeFormatter, DataError>
A version of [Self :: try_new_narrow_minute
] that uses custom data provided by a DataProvider
.
sourcepub fn try_new_narrow_hour(
locale: &DataLocale,
options: RelativeTimeFormatterOptions,
) -> Result<RelativeTimeFormatter, DataError>
pub fn try_new_narrow_hour( locale: &DataLocale, options: RelativeTimeFormatterOptions, ) -> Result<RelativeTimeFormatter, DataError>
Create a new RelativeTimeFormatter
from compiled data.
✨ Enabled with the compiled_data
Cargo feature.
sourcepub fn try_new_narrow_hour_with_any_provider(
provider: &(impl AnyProvider + ?Sized),
locale: &DataLocale,
options: RelativeTimeFormatterOptions,
) -> Result<RelativeTimeFormatter, DataError>
pub fn try_new_narrow_hour_with_any_provider( provider: &(impl AnyProvider + ?Sized), locale: &DataLocale, options: RelativeTimeFormatterOptions, ) -> Result<RelativeTimeFormatter, DataError>
A version of [Self :: try_new_narrow_hour
] that uses custom data provided by an AnyProvider
.
sourcepub fn try_new_narrow_hour_with_buffer_provider(
provider: &(impl BufferProvider + ?Sized),
locale: &DataLocale,
options: RelativeTimeFormatterOptions,
) -> Result<RelativeTimeFormatter, DataError>
pub fn try_new_narrow_hour_with_buffer_provider( provider: &(impl BufferProvider + ?Sized), locale: &DataLocale, options: RelativeTimeFormatterOptions, ) -> Result<RelativeTimeFormatter, 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,
locale: &DataLocale,
options: RelativeTimeFormatterOptions,
) -> Result<RelativeTimeFormatter, DataError>
pub fn try_new_narrow_hour_unstable<D>( provider: &D, locale: &DataLocale, options: RelativeTimeFormatterOptions, ) -> Result<RelativeTimeFormatter, DataError>
A version of [Self :: try_new_narrow_hour
] that uses custom data provided by a DataProvider
.
sourcepub fn try_new_narrow_day(
locale: &DataLocale,
options: RelativeTimeFormatterOptions,
) -> Result<RelativeTimeFormatter, DataError>
pub fn try_new_narrow_day( locale: &DataLocale, options: RelativeTimeFormatterOptions, ) -> Result<RelativeTimeFormatter, DataError>
Create a new RelativeTimeFormatter
from compiled data.
✨ Enabled with the compiled_data
Cargo feature.
sourcepub fn try_new_narrow_day_with_any_provider(
provider: &(impl AnyProvider + ?Sized),
locale: &DataLocale,
options: RelativeTimeFormatterOptions,
) -> Result<RelativeTimeFormatter, DataError>
pub fn try_new_narrow_day_with_any_provider( provider: &(impl AnyProvider + ?Sized), locale: &DataLocale, options: RelativeTimeFormatterOptions, ) -> Result<RelativeTimeFormatter, DataError>
A version of [Self :: try_new_narrow_day
] that uses custom data provided by an AnyProvider
.
sourcepub fn try_new_narrow_day_with_buffer_provider(
provider: &(impl BufferProvider + ?Sized),
locale: &DataLocale,
options: RelativeTimeFormatterOptions,
) -> Result<RelativeTimeFormatter, DataError>
pub fn try_new_narrow_day_with_buffer_provider( provider: &(impl BufferProvider + ?Sized), locale: &DataLocale, options: RelativeTimeFormatterOptions, ) -> Result<RelativeTimeFormatter, 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,
locale: &DataLocale,
options: RelativeTimeFormatterOptions,
) -> Result<RelativeTimeFormatter, DataError>
pub fn try_new_narrow_day_unstable<D>( provider: &D, locale: &DataLocale, options: RelativeTimeFormatterOptions, ) -> Result<RelativeTimeFormatter, DataError>
A version of [Self :: try_new_narrow_day
] that uses custom data provided by a DataProvider
.
sourcepub fn try_new_narrow_week(
locale: &DataLocale,
options: RelativeTimeFormatterOptions,
) -> Result<RelativeTimeFormatter, DataError>
pub fn try_new_narrow_week( locale: &DataLocale, options: RelativeTimeFormatterOptions, ) -> Result<RelativeTimeFormatter, DataError>
Create a new RelativeTimeFormatter
from compiled data.
✨ Enabled with the compiled_data
Cargo feature.
sourcepub fn try_new_narrow_week_with_any_provider(
provider: &(impl AnyProvider + ?Sized),
locale: &DataLocale,
options: RelativeTimeFormatterOptions,
) -> Result<RelativeTimeFormatter, DataError>
pub fn try_new_narrow_week_with_any_provider( provider: &(impl AnyProvider + ?Sized), locale: &DataLocale, options: RelativeTimeFormatterOptions, ) -> Result<RelativeTimeFormatter, DataError>
A version of [Self :: try_new_narrow_week
] that uses custom data provided by an AnyProvider
.
sourcepub fn try_new_narrow_week_with_buffer_provider(
provider: &(impl BufferProvider + ?Sized),
locale: &DataLocale,
options: RelativeTimeFormatterOptions,
) -> Result<RelativeTimeFormatter, DataError>
pub fn try_new_narrow_week_with_buffer_provider( provider: &(impl BufferProvider + ?Sized), locale: &DataLocale, options: RelativeTimeFormatterOptions, ) -> Result<RelativeTimeFormatter, 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,
locale: &DataLocale,
options: RelativeTimeFormatterOptions,
) -> Result<RelativeTimeFormatter, DataError>
pub fn try_new_narrow_week_unstable<D>( provider: &D, locale: &DataLocale, options: RelativeTimeFormatterOptions, ) -> Result<RelativeTimeFormatter, DataError>
A version of [Self :: try_new_narrow_week
] that uses custom data provided by a DataProvider
.
sourcepub fn try_new_narrow_month(
locale: &DataLocale,
options: RelativeTimeFormatterOptions,
) -> Result<RelativeTimeFormatter, DataError>
pub fn try_new_narrow_month( locale: &DataLocale, options: RelativeTimeFormatterOptions, ) -> Result<RelativeTimeFormatter, DataError>
Create a new RelativeTimeFormatter
from compiled data.
✨ Enabled with the compiled_data
Cargo feature.
sourcepub fn try_new_narrow_month_with_any_provider(
provider: &(impl AnyProvider + ?Sized),
locale: &DataLocale,
options: RelativeTimeFormatterOptions,
) -> Result<RelativeTimeFormatter, DataError>
pub fn try_new_narrow_month_with_any_provider( provider: &(impl AnyProvider + ?Sized), locale: &DataLocale, options: RelativeTimeFormatterOptions, ) -> Result<RelativeTimeFormatter, DataError>
A version of [Self :: try_new_narrow_month
] that uses custom data provided by an AnyProvider
.
sourcepub fn try_new_narrow_month_with_buffer_provider(
provider: &(impl BufferProvider + ?Sized),
locale: &DataLocale,
options: RelativeTimeFormatterOptions,
) -> Result<RelativeTimeFormatter, DataError>
pub fn try_new_narrow_month_with_buffer_provider( provider: &(impl BufferProvider + ?Sized), locale: &DataLocale, options: RelativeTimeFormatterOptions, ) -> Result<RelativeTimeFormatter, 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,
locale: &DataLocale,
options: RelativeTimeFormatterOptions,
) -> Result<RelativeTimeFormatter, DataError>
pub fn try_new_narrow_month_unstable<D>( provider: &D, locale: &DataLocale, options: RelativeTimeFormatterOptions, ) -> Result<RelativeTimeFormatter, DataError>
A version of [Self :: try_new_narrow_month
] that uses custom data provided by a DataProvider
.
sourcepub fn try_new_narrow_quarter(
locale: &DataLocale,
options: RelativeTimeFormatterOptions,
) -> Result<RelativeTimeFormatter, DataError>
pub fn try_new_narrow_quarter( locale: &DataLocale, options: RelativeTimeFormatterOptions, ) -> Result<RelativeTimeFormatter, DataError>
Create a new RelativeTimeFormatter
from compiled data.
✨ Enabled with the compiled_data
Cargo feature.
sourcepub fn try_new_narrow_quarter_with_any_provider(
provider: &(impl AnyProvider + ?Sized),
locale: &DataLocale,
options: RelativeTimeFormatterOptions,
) -> Result<RelativeTimeFormatter, DataError>
pub fn try_new_narrow_quarter_with_any_provider( provider: &(impl AnyProvider + ?Sized), locale: &DataLocale, options: RelativeTimeFormatterOptions, ) -> Result<RelativeTimeFormatter, DataError>
A version of [Self :: try_new_narrow_quarter
] that uses custom data provided by an AnyProvider
.
sourcepub fn try_new_narrow_quarter_with_buffer_provider(
provider: &(impl BufferProvider + ?Sized),
locale: &DataLocale,
options: RelativeTimeFormatterOptions,
) -> Result<RelativeTimeFormatter, DataError>
pub fn try_new_narrow_quarter_with_buffer_provider( provider: &(impl BufferProvider + ?Sized), locale: &DataLocale, options: RelativeTimeFormatterOptions, ) -> Result<RelativeTimeFormatter, 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,
locale: &DataLocale,
options: RelativeTimeFormatterOptions,
) -> Result<RelativeTimeFormatter, DataError>
pub fn try_new_narrow_quarter_unstable<D>( provider: &D, locale: &DataLocale, options: RelativeTimeFormatterOptions, ) -> Result<RelativeTimeFormatter, DataError>
A version of [Self :: try_new_narrow_quarter
] that uses custom data provided by a DataProvider
.
sourcepub fn try_new_narrow_year(
locale: &DataLocale,
options: RelativeTimeFormatterOptions,
) -> Result<RelativeTimeFormatter, DataError>
pub fn try_new_narrow_year( locale: &DataLocale, options: RelativeTimeFormatterOptions, ) -> Result<RelativeTimeFormatter, DataError>
Create a new RelativeTimeFormatter
from compiled data.
✨ Enabled with the compiled_data
Cargo feature.
sourcepub fn try_new_narrow_year_with_any_provider(
provider: &(impl AnyProvider + ?Sized),
locale: &DataLocale,
options: RelativeTimeFormatterOptions,
) -> Result<RelativeTimeFormatter, DataError>
pub fn try_new_narrow_year_with_any_provider( provider: &(impl AnyProvider + ?Sized), locale: &DataLocale, options: RelativeTimeFormatterOptions, ) -> Result<RelativeTimeFormatter, DataError>
A version of [Self :: try_new_narrow_year
] that uses custom data provided by an AnyProvider
.
sourcepub fn try_new_narrow_year_with_buffer_provider(
provider: &(impl BufferProvider + ?Sized),
locale: &DataLocale,
options: RelativeTimeFormatterOptions,
) -> Result<RelativeTimeFormatter, DataError>
pub fn try_new_narrow_year_with_buffer_provider( provider: &(impl BufferProvider + ?Sized), locale: &DataLocale, options: RelativeTimeFormatterOptions, ) -> Result<RelativeTimeFormatter, 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,
locale: &DataLocale,
options: RelativeTimeFormatterOptions,
) -> Result<RelativeTimeFormatter, DataError>
pub fn try_new_narrow_year_unstable<D>( provider: &D, locale: &DataLocale, options: RelativeTimeFormatterOptions, ) -> Result<RelativeTimeFormatter, DataError>
A version of [Self :: try_new_narrow_year
] that uses custom data provided by a DataProvider
.
sourcepub fn format(&self, value: FixedDecimal) -> FormattedRelativeTime<'_>
pub fn format(&self, value: FixedDecimal) -> 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