Struct icu_capi::datetime_formatter::ffi::DateFormatter
source · pub struct DateFormatter(pub DateTimeFormatter<YMD>);
Expand description
An ICU4X DateFormatter object capable of formatting a Date
as a string,
using some calendar specified at runtime in the locale.
Tuple Fields§
§0: DateTimeFormatter<YMD>
Implementations§
source§impl DateFormatter
impl DateFormatter
sourcepub fn create_with_length(
locale: &Locale,
length: DateTimeLength,
) -> Result<Box<DateFormatter>, DateTimeFormatterLoadError>
pub fn create_with_length( locale: &Locale, length: DateTimeLength, ) -> Result<Box<DateFormatter>, DateTimeFormatterLoadError>
Creates a new DateFormatter
using compiled data.
sourcepub fn create_with_length_and_provider(
provider: &DataProvider,
locale: &Locale,
length: DateTimeLength,
) -> Result<Box<DateFormatter>, DateTimeFormatterLoadError>
pub fn create_with_length_and_provider( provider: &DataProvider, locale: &Locale, length: DateTimeLength, ) -> Result<Box<DateFormatter>, DateTimeFormatterLoadError>
Creates a new DateFormatter
using a particular data source.
sourcepub fn format_date(
&self,
value: &Date,
write: &mut DiplomatWrite,
) -> Result<(), DateTimeFormatError>
pub fn format_date( &self, value: &Date, write: &mut DiplomatWrite, ) -> Result<(), DateTimeFormatError>
Formats a Date
to a string.
sourcepub fn format_iso_date(
&self,
value: &IsoDate,
write: &mut DiplomatWrite,
) -> Result<(), DateTimeFormatError>
pub fn format_iso_date( &self, value: &IsoDate, write: &mut DiplomatWrite, ) -> Result<(), DateTimeFormatError>
Formats a IsoDate
to a string.
Will convert to this formatter’s calendar first
sourcepub fn format_datetime(
&self,
value: &DateTime,
write: &mut DiplomatWrite,
) -> Result<(), DateTimeFormatError>
pub fn format_datetime( &self, value: &DateTime, write: &mut DiplomatWrite, ) -> Result<(), DateTimeFormatError>
Formats a DateTime
to a string.
sourcepub fn format_iso_datetime(
&self,
value: &IsoDateTime,
write: &mut DiplomatWrite,
) -> Result<(), DateTimeFormatError>
pub fn format_iso_datetime( &self, value: &IsoDateTime, write: &mut DiplomatWrite, ) -> Result<(), DateTimeFormatError>
Formats a IsoDateTime
to a string.
Will convert to this formatter’s calendar first
sourcepub fn calendar_kind(&self) -> AnyCalendarKind
pub fn calendar_kind(&self) -> AnyCalendarKind
Returns the calendar system used in this formatter.
Auto Trait Implementations§
impl Freeze for DateFormatter
impl RefUnwindSafe for DateFormatter
impl Send for DateFormatter
impl Sync for DateFormatter
impl Unpin for DateFormatter
impl UnwindSafe for DateFormatter
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
Mutably borrows from an owned value. Read more
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>
Converts
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>
Converts
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