pub struct FluentDateTime {
pub options: FluentDateTimeOptions,
/* private fields */
}
Expand description
An ICU DateTime
with attached formatting options
Construct from an icu_calendar::DateTime
using From / Into.
Convert to a FluentValue
with From / Into.
See FluentDateTimeOptions
and FluentDateTimeOptions::default
.
use icu_calendar::DateTime;
use fluent_datetime::FluentDateTime;
let datetime = DateTime::try_new_iso_datetime(1989, 11, 9, 23, 30, 0)
.expect("Failed to create ICU DateTime");
let datetime = FluentDateTime::from(datetime);
Fields§
§options: FluentDateTimeOptions
Options for rendering
Trait Implementations§
Source§impl Clone for FluentDateTime
impl Clone for FluentDateTime
Source§fn clone(&self) -> FluentDateTime
fn clone(&self) -> FluentDateTime
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for FluentDateTime
impl Debug for FluentDateTime
Source§impl FluentType for FluentDateTime
impl FluentType for FluentDateTime
Source§fn as_string(&self, intls: &IntlLangMemoizer) -> Cow<'static, str>
fn as_string(&self, intls: &IntlLangMemoizer) -> Cow<'static, str>
Convert the custom type into a string value, for instance a custom DateTime
type could return “Oct. 27, 2022”.
Source§fn as_string_threadsafe(&self, intls: &IntlLangMemoizer) -> Cow<'static, str>
fn as_string_threadsafe(&self, intls: &IntlLangMemoizer) -> Cow<'static, str>
Convert the custom type into a string value, for instance a custom DateTime
type could return “Oct. 27, 2022”. This operation is provided the threadsafe
IntlLangMemoizer.
Source§impl From<FluentDateTime> for FluentValue<'static>
impl From<FluentDateTime> for FluentValue<'static>
Source§fn from(value: FluentDateTime) -> Self
fn from(value: FluentDateTime) -> Self
Converts to this type from the input type.
Source§impl PartialEq for FluentDateTime
impl PartialEq for FluentDateTime
impl StructuralPartialEq for FluentDateTime
Auto Trait Implementations§
impl Freeze for FluentDateTime
impl RefUnwindSafe for FluentDateTime
impl Send for FluentDateTime
impl Sync for FluentDateTime
impl Unpin for FluentDateTime
impl UnwindSafe for FluentDateTime
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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