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