pub struct FluentNaiveDateTime(pub NaiveDateTime);Expand description
Wrapper for chrono NaiveDateTime that automatically converts to Fluent’s expected millisecond format.
While this wrapper can be used, chrono NaiveDateTime types implement Res directly,
so you can pass them to arg() without wrapping. Note: assumes UTC timezone for the conversion.
§Example
ⓘ
let now = Utc::now().naive_utc();
// Naive datetimes work directly with arg() (assumes UTC)
Label::new(cx, Localized::new("event-date").arg("date", now));Tuple Fields§
§0: NaiveDateTimeTrait Implementations§
Source§impl Clone for FluentNaiveDateTime
impl Clone for FluentNaiveDateTime
Source§fn clone(&self) -> FluentNaiveDateTime
fn clone(&self) -> FluentNaiveDateTime
Returns a duplicate 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 From<FluentNaiveDateTime> for FluentValue<'static>
impl From<FluentNaiveDateTime> for FluentValue<'static>
Source§fn from(val: FluentNaiveDateTime) -> Self
fn from(val: FluentNaiveDateTime) -> Self
Converts to this type from the input type.
Source§impl Res<FluentNaiveDateTime> for FluentNaiveDateTime
impl Res<FluentNaiveDateTime> for FluentNaiveDateTime
Source§fn get_value(&self, _: &impl DataContext) -> Self
fn get_value(&self, _: &impl DataContext) -> Self
Returns the value of a resource by value.
fn set_or_bind<F>(self, cx: &mut Context, closure: F)
Source§impl Res<FluentNaiveDateTime> for NaiveDateTime
impl Res<FluentNaiveDateTime> for NaiveDateTime
Source§fn get_value(&self, _: &impl DataContext) -> FluentNaiveDateTime
fn get_value(&self, _: &impl DataContext) -> FluentNaiveDateTime
Returns the value of a resource by value.
fn set_or_bind<F>(self, cx: &mut Context, closure: F)
Auto Trait Implementations§
impl Freeze for FluentNaiveDateTime
impl RefUnwindSafe for FluentNaiveDateTime
impl Send for FluentNaiveDateTime
impl Sync for FluentNaiveDateTime
impl Unpin for FluentNaiveDateTime
impl UnsafeUnpin for FluentNaiveDateTime
impl UnwindSafe for FluentNaiveDateTime
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,
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.