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::SignedFixedDecimal;
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(SignedFixedDecimal::from(5i8)),
"in 5 seconds"
);
assert_writeable_eq!(
relative_time_formatter.format(SignedFixedDecimal::from(-10i8)),
"10 seconds ago"
);
§Example
use fixed_decimal::SignedFixedDecimal;
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(SignedFixedDecimal::from(0u8)),
"hoy"
);
assert_writeable_eq!(
relative_time_formatter.format(SignedFixedDecimal::from(-2i8)),
"anteayer"
);
assert_writeable_eq!(
relative_time_formatter.format(SignedFixedDecimal::from(2u8)),
"pasado mañana"
);
assert_writeable_eq!(
relative_time_formatter.format(SignedFixedDecimal::from(15i8)),
"dentro de 15 d"
);
§Example
use fixed_decimal::SignedFixedDecimal;
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(SignedFixedDecimal::from(3u8)),
"৩ বছরে"
);
assert_writeable_eq!(
relative_time_formatter.format(SignedFixedDecimal::from(-15i8)),
"১৫ বছর পূর্বে"
);
Implementations§
source§impl RelativeTimeFormatter
impl RelativeTimeFormatter
sourcepub fn try_new_long_second(
prefs: RelativeTimeFormatterPreferences,
options: RelativeTimeFormatterOptions,
) -> Result<RelativeTimeFormatter, DataError>
pub fn try_new_long_second( prefs: RelativeTimeFormatterPreferences, 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),
prefs: RelativeTimeFormatterPreferences,
options: RelativeTimeFormatterOptions,
) -> Result<RelativeTimeFormatter, DataError>
pub fn try_new_long_second_with_any_provider( provider: &(impl AnyProvider + ?Sized), prefs: RelativeTimeFormatterPreferences, 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),
prefs: RelativeTimeFormatterPreferences,
options: RelativeTimeFormatterOptions,
) -> Result<RelativeTimeFormatter, DataError>
pub fn try_new_long_second_with_buffer_provider( provider: &(impl BufferProvider + ?Sized), prefs: RelativeTimeFormatterPreferences, 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,
prefs: RelativeTimeFormatterPreferences,
options: RelativeTimeFormatterOptions,
) -> Result<RelativeTimeFormatter, DataError>
pub fn try_new_long_second_unstable<D>( provider: &D, prefs: RelativeTimeFormatterPreferences, 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(
prefs: RelativeTimeFormatterPreferences,
options: RelativeTimeFormatterOptions,
) -> Result<RelativeTimeFormatter, DataError>
pub fn try_new_long_minute( prefs: RelativeTimeFormatterPreferences, 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),
prefs: RelativeTimeFormatterPreferences,
options: RelativeTimeFormatterOptions,
) -> Result<RelativeTimeFormatter, DataError>
pub fn try_new_long_minute_with_any_provider( provider: &(impl AnyProvider + ?Sized), prefs: RelativeTimeFormatterPreferences, 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),
prefs: RelativeTimeFormatterPreferences,
options: RelativeTimeFormatterOptions,
) -> Result<RelativeTimeFormatter, DataError>
pub fn try_new_long_minute_with_buffer_provider( provider: &(impl BufferProvider + ?Sized), prefs: RelativeTimeFormatterPreferences, 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,
prefs: RelativeTimeFormatterPreferences,
options: RelativeTimeFormatterOptions,
) -> Result<RelativeTimeFormatter, DataError>
pub fn try_new_long_minute_unstable<D>( provider: &D, prefs: RelativeTimeFormatterPreferences, 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(
prefs: RelativeTimeFormatterPreferences,
options: RelativeTimeFormatterOptions,
) -> Result<RelativeTimeFormatter, DataError>
pub fn try_new_long_hour( prefs: RelativeTimeFormatterPreferences, 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),
prefs: RelativeTimeFormatterPreferences,
options: RelativeTimeFormatterOptions,
) -> Result<RelativeTimeFormatter, DataError>
pub fn try_new_long_hour_with_any_provider( provider: &(impl AnyProvider + ?Sized), prefs: RelativeTimeFormatterPreferences, 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),
prefs: RelativeTimeFormatterPreferences,
options: RelativeTimeFormatterOptions,
) -> Result<RelativeTimeFormatter, DataError>
pub fn try_new_long_hour_with_buffer_provider( provider: &(impl BufferProvider + ?Sized), prefs: RelativeTimeFormatterPreferences, 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,
prefs: RelativeTimeFormatterPreferences,
options: RelativeTimeFormatterOptions,
) -> Result<RelativeTimeFormatter, DataError>
pub fn try_new_long_hour_unstable<D>( provider: &D, prefs: RelativeTimeFormatterPreferences, 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(
prefs: RelativeTimeFormatterPreferences,
options: RelativeTimeFormatterOptions,
) -> Result<RelativeTimeFormatter, DataError>
pub fn try_new_long_day( prefs: RelativeTimeFormatterPreferences, 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),
prefs: RelativeTimeFormatterPreferences,
options: RelativeTimeFormatterOptions,
) -> Result<RelativeTimeFormatter, DataError>
pub fn try_new_long_day_with_any_provider( provider: &(impl AnyProvider + ?Sized), prefs: RelativeTimeFormatterPreferences, 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),
prefs: RelativeTimeFormatterPreferences,
options: RelativeTimeFormatterOptions,
) -> Result<RelativeTimeFormatter, DataError>
pub fn try_new_long_day_with_buffer_provider( provider: &(impl BufferProvider + ?Sized), prefs: RelativeTimeFormatterPreferences, 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,
prefs: RelativeTimeFormatterPreferences,
options: RelativeTimeFormatterOptions,
) -> Result<RelativeTimeFormatter, DataError>
pub fn try_new_long_day_unstable<D>( provider: &D, prefs: RelativeTimeFormatterPreferences, 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(
prefs: RelativeTimeFormatterPreferences,
options: RelativeTimeFormatterOptions,
) -> Result<RelativeTimeFormatter, DataError>
pub fn try_new_long_week( prefs: RelativeTimeFormatterPreferences, 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),
prefs: RelativeTimeFormatterPreferences,
options: RelativeTimeFormatterOptions,
) -> Result<RelativeTimeFormatter, DataError>
pub fn try_new_long_week_with_any_provider( provider: &(impl AnyProvider + ?Sized), prefs: RelativeTimeFormatterPreferences, 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),
prefs: RelativeTimeFormatterPreferences,
options: RelativeTimeFormatterOptions,
) -> Result<RelativeTimeFormatter, DataError>
pub fn try_new_long_week_with_buffer_provider( provider: &(impl BufferProvider + ?Sized), prefs: RelativeTimeFormatterPreferences, 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,
prefs: RelativeTimeFormatterPreferences,
options: RelativeTimeFormatterOptions,
) -> Result<RelativeTimeFormatter, DataError>
pub fn try_new_long_week_unstable<D>( provider: &D, prefs: RelativeTimeFormatterPreferences, 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(
prefs: RelativeTimeFormatterPreferences,
options: RelativeTimeFormatterOptions,
) -> Result<RelativeTimeFormatter, DataError>
pub fn try_new_long_month( prefs: RelativeTimeFormatterPreferences, 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),
prefs: RelativeTimeFormatterPreferences,
options: RelativeTimeFormatterOptions,
) -> Result<RelativeTimeFormatter, DataError>
pub fn try_new_long_month_with_any_provider( provider: &(impl AnyProvider + ?Sized), prefs: RelativeTimeFormatterPreferences, 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),
prefs: RelativeTimeFormatterPreferences,
options: RelativeTimeFormatterOptions,
) -> Result<RelativeTimeFormatter, DataError>
pub fn try_new_long_month_with_buffer_provider( provider: &(impl BufferProvider + ?Sized), prefs: RelativeTimeFormatterPreferences, 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,
prefs: RelativeTimeFormatterPreferences,
options: RelativeTimeFormatterOptions,
) -> Result<RelativeTimeFormatter, DataError>
pub fn try_new_long_month_unstable<D>( provider: &D, prefs: RelativeTimeFormatterPreferences, 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(
prefs: RelativeTimeFormatterPreferences,
options: RelativeTimeFormatterOptions,
) -> Result<RelativeTimeFormatter, DataError>
pub fn try_new_long_quarter( prefs: RelativeTimeFormatterPreferences, 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),
prefs: RelativeTimeFormatterPreferences,
options: RelativeTimeFormatterOptions,
) -> Result<RelativeTimeFormatter, DataError>
pub fn try_new_long_quarter_with_any_provider( provider: &(impl AnyProvider + ?Sized), prefs: RelativeTimeFormatterPreferences, 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),
prefs: RelativeTimeFormatterPreferences,
options: RelativeTimeFormatterOptions,
) -> Result<RelativeTimeFormatter, DataError>
pub fn try_new_long_quarter_with_buffer_provider( provider: &(impl BufferProvider + ?Sized), prefs: RelativeTimeFormatterPreferences, 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,
prefs: RelativeTimeFormatterPreferences,
options: RelativeTimeFormatterOptions,
) -> Result<RelativeTimeFormatter, DataError>
pub fn try_new_long_quarter_unstable<D>( provider: &D, prefs: RelativeTimeFormatterPreferences, 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(
prefs: RelativeTimeFormatterPreferences,
options: RelativeTimeFormatterOptions,
) -> Result<RelativeTimeFormatter, DataError>
pub fn try_new_long_year( prefs: RelativeTimeFormatterPreferences, 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),
prefs: RelativeTimeFormatterPreferences,
options: RelativeTimeFormatterOptions,
) -> Result<RelativeTimeFormatter, DataError>
pub fn try_new_long_year_with_any_provider( provider: &(impl AnyProvider + ?Sized), prefs: RelativeTimeFormatterPreferences, 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),
prefs: RelativeTimeFormatterPreferences,
options: RelativeTimeFormatterOptions,
) -> Result<RelativeTimeFormatter, DataError>
pub fn try_new_long_year_with_buffer_provider( provider: &(impl BufferProvider + ?Sized), prefs: RelativeTimeFormatterPreferences, 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,
prefs: RelativeTimeFormatterPreferences,
options: RelativeTimeFormatterOptions,
) -> Result<RelativeTimeFormatter, DataError>
pub fn try_new_long_year_unstable<D>( provider: &D, prefs: RelativeTimeFormatterPreferences, 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(
prefs: RelativeTimeFormatterPreferences,
options: RelativeTimeFormatterOptions,
) -> Result<RelativeTimeFormatter, DataError>
pub fn try_new_short_second( prefs: RelativeTimeFormatterPreferences, 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),
prefs: RelativeTimeFormatterPreferences,
options: RelativeTimeFormatterOptions,
) -> Result<RelativeTimeFormatter, DataError>
pub fn try_new_short_second_with_any_provider( provider: &(impl AnyProvider + ?Sized), prefs: RelativeTimeFormatterPreferences, 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),
prefs: RelativeTimeFormatterPreferences,
options: RelativeTimeFormatterOptions,
) -> Result<RelativeTimeFormatter, DataError>
pub fn try_new_short_second_with_buffer_provider( provider: &(impl BufferProvider + ?Sized), prefs: RelativeTimeFormatterPreferences, 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,
prefs: RelativeTimeFormatterPreferences,
options: RelativeTimeFormatterOptions,
) -> Result<RelativeTimeFormatter, DataError>
pub fn try_new_short_second_unstable<D>( provider: &D, prefs: RelativeTimeFormatterPreferences, 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(
prefs: RelativeTimeFormatterPreferences,
options: RelativeTimeFormatterOptions,
) -> Result<RelativeTimeFormatter, DataError>
pub fn try_new_short_minute( prefs: RelativeTimeFormatterPreferences, 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),
prefs: RelativeTimeFormatterPreferences,
options: RelativeTimeFormatterOptions,
) -> Result<RelativeTimeFormatter, DataError>
pub fn try_new_short_minute_with_any_provider( provider: &(impl AnyProvider + ?Sized), prefs: RelativeTimeFormatterPreferences, 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),
prefs: RelativeTimeFormatterPreferences,
options: RelativeTimeFormatterOptions,
) -> Result<RelativeTimeFormatter, DataError>
pub fn try_new_short_minute_with_buffer_provider( provider: &(impl BufferProvider + ?Sized), prefs: RelativeTimeFormatterPreferences, 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,
prefs: RelativeTimeFormatterPreferences,
options: RelativeTimeFormatterOptions,
) -> Result<RelativeTimeFormatter, DataError>
pub fn try_new_short_minute_unstable<D>( provider: &D, prefs: RelativeTimeFormatterPreferences, 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(
prefs: RelativeTimeFormatterPreferences,
options: RelativeTimeFormatterOptions,
) -> Result<RelativeTimeFormatter, DataError>
pub fn try_new_short_hour( prefs: RelativeTimeFormatterPreferences, 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),
prefs: RelativeTimeFormatterPreferences,
options: RelativeTimeFormatterOptions,
) -> Result<RelativeTimeFormatter, DataError>
pub fn try_new_short_hour_with_any_provider( provider: &(impl AnyProvider + ?Sized), prefs: RelativeTimeFormatterPreferences, 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),
prefs: RelativeTimeFormatterPreferences,
options: RelativeTimeFormatterOptions,
) -> Result<RelativeTimeFormatter, DataError>
pub fn try_new_short_hour_with_buffer_provider( provider: &(impl BufferProvider + ?Sized), prefs: RelativeTimeFormatterPreferences, 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,
prefs: RelativeTimeFormatterPreferences,
options: RelativeTimeFormatterOptions,
) -> Result<RelativeTimeFormatter, DataError>
pub fn try_new_short_hour_unstable<D>( provider: &D, prefs: RelativeTimeFormatterPreferences, 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(
prefs: RelativeTimeFormatterPreferences,
options: RelativeTimeFormatterOptions,
) -> Result<RelativeTimeFormatter, DataError>
pub fn try_new_short_day( prefs: RelativeTimeFormatterPreferences, 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),
prefs: RelativeTimeFormatterPreferences,
options: RelativeTimeFormatterOptions,
) -> Result<RelativeTimeFormatter, DataError>
pub fn try_new_short_day_with_any_provider( provider: &(impl AnyProvider + ?Sized), prefs: RelativeTimeFormatterPreferences, 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),
prefs: RelativeTimeFormatterPreferences,
options: RelativeTimeFormatterOptions,
) -> Result<RelativeTimeFormatter, DataError>
pub fn try_new_short_day_with_buffer_provider( provider: &(impl BufferProvider + ?Sized), prefs: RelativeTimeFormatterPreferences, 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,
prefs: RelativeTimeFormatterPreferences,
options: RelativeTimeFormatterOptions,
) -> Result<RelativeTimeFormatter, DataError>
pub fn try_new_short_day_unstable<D>( provider: &D, prefs: RelativeTimeFormatterPreferences, 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(
prefs: RelativeTimeFormatterPreferences,
options: RelativeTimeFormatterOptions,
) -> Result<RelativeTimeFormatter, DataError>
pub fn try_new_short_week( prefs: RelativeTimeFormatterPreferences, 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),
prefs: RelativeTimeFormatterPreferences,
options: RelativeTimeFormatterOptions,
) -> Result<RelativeTimeFormatter, DataError>
pub fn try_new_short_week_with_any_provider( provider: &(impl AnyProvider + ?Sized), prefs: RelativeTimeFormatterPreferences, 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),
prefs: RelativeTimeFormatterPreferences,
options: RelativeTimeFormatterOptions,
) -> Result<RelativeTimeFormatter, DataError>
pub fn try_new_short_week_with_buffer_provider( provider: &(impl BufferProvider + ?Sized), prefs: RelativeTimeFormatterPreferences, 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,
prefs: RelativeTimeFormatterPreferences,
options: RelativeTimeFormatterOptions,
) -> Result<RelativeTimeFormatter, DataError>
pub fn try_new_short_week_unstable<D>( provider: &D, prefs: RelativeTimeFormatterPreferences, 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(
prefs: RelativeTimeFormatterPreferences,
options: RelativeTimeFormatterOptions,
) -> Result<RelativeTimeFormatter, DataError>
pub fn try_new_short_month( prefs: RelativeTimeFormatterPreferences, 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),
prefs: RelativeTimeFormatterPreferences,
options: RelativeTimeFormatterOptions,
) -> Result<RelativeTimeFormatter, DataError>
pub fn try_new_short_month_with_any_provider( provider: &(impl AnyProvider + ?Sized), prefs: RelativeTimeFormatterPreferences, 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),
prefs: RelativeTimeFormatterPreferences,
options: RelativeTimeFormatterOptions,
) -> Result<RelativeTimeFormatter, DataError>
pub fn try_new_short_month_with_buffer_provider( provider: &(impl BufferProvider + ?Sized), prefs: RelativeTimeFormatterPreferences, 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,
prefs: RelativeTimeFormatterPreferences,
options: RelativeTimeFormatterOptions,
) -> Result<RelativeTimeFormatter, DataError>
pub fn try_new_short_month_unstable<D>( provider: &D, prefs: RelativeTimeFormatterPreferences, 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(
prefs: RelativeTimeFormatterPreferences,
options: RelativeTimeFormatterOptions,
) -> Result<RelativeTimeFormatter, DataError>
pub fn try_new_short_quarter( prefs: RelativeTimeFormatterPreferences, 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),
prefs: RelativeTimeFormatterPreferences,
options: RelativeTimeFormatterOptions,
) -> Result<RelativeTimeFormatter, DataError>
pub fn try_new_short_quarter_with_any_provider( provider: &(impl AnyProvider + ?Sized), prefs: RelativeTimeFormatterPreferences, 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),
prefs: RelativeTimeFormatterPreferences,
options: RelativeTimeFormatterOptions,
) -> Result<RelativeTimeFormatter, DataError>
pub fn try_new_short_quarter_with_buffer_provider( provider: &(impl BufferProvider + ?Sized), prefs: RelativeTimeFormatterPreferences, 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,
prefs: RelativeTimeFormatterPreferences,
options: RelativeTimeFormatterOptions,
) -> Result<RelativeTimeFormatter, DataError>
pub fn try_new_short_quarter_unstable<D>( provider: &D, prefs: RelativeTimeFormatterPreferences, 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(
prefs: RelativeTimeFormatterPreferences,
options: RelativeTimeFormatterOptions,
) -> Result<RelativeTimeFormatter, DataError>
pub fn try_new_short_year( prefs: RelativeTimeFormatterPreferences, 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),
prefs: RelativeTimeFormatterPreferences,
options: RelativeTimeFormatterOptions,
) -> Result<RelativeTimeFormatter, DataError>
pub fn try_new_short_year_with_any_provider( provider: &(impl AnyProvider + ?Sized), prefs: RelativeTimeFormatterPreferences, 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),
prefs: RelativeTimeFormatterPreferences,
options: RelativeTimeFormatterOptions,
) -> Result<RelativeTimeFormatter, DataError>
pub fn try_new_short_year_with_buffer_provider( provider: &(impl BufferProvider + ?Sized), prefs: RelativeTimeFormatterPreferences, 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,
prefs: RelativeTimeFormatterPreferences,
options: RelativeTimeFormatterOptions,
) -> Result<RelativeTimeFormatter, DataError>
pub fn try_new_short_year_unstable<D>( provider: &D, prefs: RelativeTimeFormatterPreferences, 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(
prefs: RelativeTimeFormatterPreferences,
options: RelativeTimeFormatterOptions,
) -> Result<RelativeTimeFormatter, DataError>
pub fn try_new_narrow_second( prefs: RelativeTimeFormatterPreferences, 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),
prefs: RelativeTimeFormatterPreferences,
options: RelativeTimeFormatterOptions,
) -> Result<RelativeTimeFormatter, DataError>
pub fn try_new_narrow_second_with_any_provider( provider: &(impl AnyProvider + ?Sized), prefs: RelativeTimeFormatterPreferences, 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),
prefs: RelativeTimeFormatterPreferences,
options: RelativeTimeFormatterOptions,
) -> Result<RelativeTimeFormatter, DataError>
pub fn try_new_narrow_second_with_buffer_provider( provider: &(impl BufferProvider + ?Sized), prefs: RelativeTimeFormatterPreferences, 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,
prefs: RelativeTimeFormatterPreferences,
options: RelativeTimeFormatterOptions,
) -> Result<RelativeTimeFormatter, DataError>
pub fn try_new_narrow_second_unstable<D>( provider: &D, prefs: RelativeTimeFormatterPreferences, 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(
prefs: RelativeTimeFormatterPreferences,
options: RelativeTimeFormatterOptions,
) -> Result<RelativeTimeFormatter, DataError>
pub fn try_new_narrow_minute( prefs: RelativeTimeFormatterPreferences, 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),
prefs: RelativeTimeFormatterPreferences,
options: RelativeTimeFormatterOptions,
) -> Result<RelativeTimeFormatter, DataError>
pub fn try_new_narrow_minute_with_any_provider( provider: &(impl AnyProvider + ?Sized), prefs: RelativeTimeFormatterPreferences, 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),
prefs: RelativeTimeFormatterPreferences,
options: RelativeTimeFormatterOptions,
) -> Result<RelativeTimeFormatter, DataError>
pub fn try_new_narrow_minute_with_buffer_provider( provider: &(impl BufferProvider + ?Sized), prefs: RelativeTimeFormatterPreferences, 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,
prefs: RelativeTimeFormatterPreferences,
options: RelativeTimeFormatterOptions,
) -> Result<RelativeTimeFormatter, DataError>
pub fn try_new_narrow_minute_unstable<D>( provider: &D, prefs: RelativeTimeFormatterPreferences, 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(
prefs: RelativeTimeFormatterPreferences,
options: RelativeTimeFormatterOptions,
) -> Result<RelativeTimeFormatter, DataError>
pub fn try_new_narrow_hour( prefs: RelativeTimeFormatterPreferences, 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),
prefs: RelativeTimeFormatterPreferences,
options: RelativeTimeFormatterOptions,
) -> Result<RelativeTimeFormatter, DataError>
pub fn try_new_narrow_hour_with_any_provider( provider: &(impl AnyProvider + ?Sized), prefs: RelativeTimeFormatterPreferences, 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),
prefs: RelativeTimeFormatterPreferences,
options: RelativeTimeFormatterOptions,
) -> Result<RelativeTimeFormatter, DataError>
pub fn try_new_narrow_hour_with_buffer_provider( provider: &(impl BufferProvider + ?Sized), prefs: RelativeTimeFormatterPreferences, 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,
prefs: RelativeTimeFormatterPreferences,
options: RelativeTimeFormatterOptions,
) -> Result<RelativeTimeFormatter, DataError>
pub fn try_new_narrow_hour_unstable<D>( provider: &D, prefs: RelativeTimeFormatterPreferences, 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(
prefs: RelativeTimeFormatterPreferences,
options: RelativeTimeFormatterOptions,
) -> Result<RelativeTimeFormatter, DataError>
pub fn try_new_narrow_day( prefs: RelativeTimeFormatterPreferences, 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),
prefs: RelativeTimeFormatterPreferences,
options: RelativeTimeFormatterOptions,
) -> Result<RelativeTimeFormatter, DataError>
pub fn try_new_narrow_day_with_any_provider( provider: &(impl AnyProvider + ?Sized), prefs: RelativeTimeFormatterPreferences, 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),
prefs: RelativeTimeFormatterPreferences,
options: RelativeTimeFormatterOptions,
) -> Result<RelativeTimeFormatter, DataError>
pub fn try_new_narrow_day_with_buffer_provider( provider: &(impl BufferProvider + ?Sized), prefs: RelativeTimeFormatterPreferences, 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,
prefs: RelativeTimeFormatterPreferences,
options: RelativeTimeFormatterOptions,
) -> Result<RelativeTimeFormatter, DataError>
pub fn try_new_narrow_day_unstable<D>( provider: &D, prefs: RelativeTimeFormatterPreferences, 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(
prefs: RelativeTimeFormatterPreferences,
options: RelativeTimeFormatterOptions,
) -> Result<RelativeTimeFormatter, DataError>
pub fn try_new_narrow_week( prefs: RelativeTimeFormatterPreferences, 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),
prefs: RelativeTimeFormatterPreferences,
options: RelativeTimeFormatterOptions,
) -> Result<RelativeTimeFormatter, DataError>
pub fn try_new_narrow_week_with_any_provider( provider: &(impl AnyProvider + ?Sized), prefs: RelativeTimeFormatterPreferences, 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),
prefs: RelativeTimeFormatterPreferences,
options: RelativeTimeFormatterOptions,
) -> Result<RelativeTimeFormatter, DataError>
pub fn try_new_narrow_week_with_buffer_provider( provider: &(impl BufferProvider + ?Sized), prefs: RelativeTimeFormatterPreferences, 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,
prefs: RelativeTimeFormatterPreferences,
options: RelativeTimeFormatterOptions,
) -> Result<RelativeTimeFormatter, DataError>
pub fn try_new_narrow_week_unstable<D>( provider: &D, prefs: RelativeTimeFormatterPreferences, 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(
prefs: RelativeTimeFormatterPreferences,
options: RelativeTimeFormatterOptions,
) -> Result<RelativeTimeFormatter, DataError>
pub fn try_new_narrow_month( prefs: RelativeTimeFormatterPreferences, 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),
prefs: RelativeTimeFormatterPreferences,
options: RelativeTimeFormatterOptions,
) -> Result<RelativeTimeFormatter, DataError>
pub fn try_new_narrow_month_with_any_provider( provider: &(impl AnyProvider + ?Sized), prefs: RelativeTimeFormatterPreferences, 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),
prefs: RelativeTimeFormatterPreferences,
options: RelativeTimeFormatterOptions,
) -> Result<RelativeTimeFormatter, DataError>
pub fn try_new_narrow_month_with_buffer_provider( provider: &(impl BufferProvider + ?Sized), prefs: RelativeTimeFormatterPreferences, 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,
prefs: RelativeTimeFormatterPreferences,
options: RelativeTimeFormatterOptions,
) -> Result<RelativeTimeFormatter, DataError>
pub fn try_new_narrow_month_unstable<D>( provider: &D, prefs: RelativeTimeFormatterPreferences, 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(
prefs: RelativeTimeFormatterPreferences,
options: RelativeTimeFormatterOptions,
) -> Result<RelativeTimeFormatter, DataError>
pub fn try_new_narrow_quarter( prefs: RelativeTimeFormatterPreferences, 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),
prefs: RelativeTimeFormatterPreferences,
options: RelativeTimeFormatterOptions,
) -> Result<RelativeTimeFormatter, DataError>
pub fn try_new_narrow_quarter_with_any_provider( provider: &(impl AnyProvider + ?Sized), prefs: RelativeTimeFormatterPreferences, 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),
prefs: RelativeTimeFormatterPreferences,
options: RelativeTimeFormatterOptions,
) -> Result<RelativeTimeFormatter, DataError>
pub fn try_new_narrow_quarter_with_buffer_provider( provider: &(impl BufferProvider + ?Sized), prefs: RelativeTimeFormatterPreferences, 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,
prefs: RelativeTimeFormatterPreferences,
options: RelativeTimeFormatterOptions,
) -> Result<RelativeTimeFormatter, DataError>
pub fn try_new_narrow_quarter_unstable<D>( provider: &D, prefs: RelativeTimeFormatterPreferences, 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(
prefs: RelativeTimeFormatterPreferences,
options: RelativeTimeFormatterOptions,
) -> Result<RelativeTimeFormatter, DataError>
pub fn try_new_narrow_year( prefs: RelativeTimeFormatterPreferences, 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),
prefs: RelativeTimeFormatterPreferences,
options: RelativeTimeFormatterOptions,
) -> Result<RelativeTimeFormatter, DataError>
pub fn try_new_narrow_year_with_any_provider( provider: &(impl AnyProvider + ?Sized), prefs: RelativeTimeFormatterPreferences, 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),
prefs: RelativeTimeFormatterPreferences,
options: RelativeTimeFormatterOptions,
) -> Result<RelativeTimeFormatter, DataError>
pub fn try_new_narrow_year_with_buffer_provider( provider: &(impl BufferProvider + ?Sized), prefs: RelativeTimeFormatterPreferences, 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,
prefs: RelativeTimeFormatterPreferences,
options: RelativeTimeFormatterOptions,
) -> Result<RelativeTimeFormatter, DataError>
pub fn try_new_narrow_year_unstable<D>( provider: &D, prefs: RelativeTimeFormatterPreferences, 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: Signed<UnsignedFixedDecimal>,
) -> FormattedRelativeTime<'_>
pub fn format( &self, value: Signed<UnsignedFixedDecimal>, ) -> 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