Struct icu_capi::datetime_formatter::ffi::DateTimeFormatter
source · pub struct DateTimeFormatter(pub DateTimeFormatter<YMDT>);
Expand description
An ICU4X DateFormatter object capable of formatting a DateTime
as a string,
using some calendar specified at runtime in the locale.
Tuple Fields§
§0: DateTimeFormatter<YMDT>
Implementations§
source§impl DateTimeFormatter
impl DateTimeFormatter
sourcepub fn create_with_length(
locale: &Locale,
length: DateTimeLength,
) -> Result<Box<DateTimeFormatter>, DateTimeFormatterLoadError>
pub fn create_with_length( locale: &Locale, length: DateTimeLength, ) -> Result<Box<DateTimeFormatter>, DateTimeFormatterLoadError>
Creates a new DateTimeFormatter
using compiled data.
sourcepub fn create_with_length_and_provider(
provider: &DataProvider,
locale: &Locale,
length: DateTimeLength,
) -> Result<Box<DateTimeFormatter>, DateTimeFormatterLoadError>
pub fn create_with_length_and_provider( provider: &DataProvider, locale: &Locale, length: DateTimeLength, ) -> Result<Box<DateTimeFormatter>, DateTimeFormatterLoadError>
Creates a new DateTimeFormatter
using a particular data source.
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 DateTimeFormatter
impl RefUnwindSafe for DateTimeFormatter
impl Send for DateTimeFormatter
impl Sync for DateTimeFormatter
impl Unpin for DateTimeFormatter
impl UnwindSafe for DateTimeFormatter
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