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(
provider: &DataProvider,
locale: &Locale,
length: DateTimeLength,
) -> Result<Box<DateFormatter>, PatternLoadError>
pub fn create_with_length( provider: &DataProvider, locale: &Locale, length: DateTimeLength, ) -> Result<Box<DateFormatter>, PatternLoadError>
Creates a new DateFormatter
from locale data.
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
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