pub struct FluentCivilDateTime(pub DateTime);Expand description
Wrapper for a jiff civil DateTime that automatically converts to Fluent’s expected
millisecond format.
While this wrapper can be used, [civil::DateTime] implements Res directly,
so you can pass it to arg() without wrapping. Note: assumes UTC timezone for the conversion.
A civil datetime too close to the edge of the supported range to be placed in UTC converts to
a Fluent error value.
§Example
ⓘ
let now = Timestamp::now().to_zoned_datetime(TimeZone::UTC).datetime();
// Civil datetimes work directly with arg() (assumes UTC)
Label::new(cx, Localized::new("event-date").arg("date", now));Tuple Fields§
§0: DateTimeTrait Implementations§
Source§impl Clone for FluentCivilDateTime
impl Clone for FluentCivilDateTime
Source§fn clone(&self) -> FluentCivilDateTime
fn clone(&self) -> FluentCivilDateTime
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for FluentCivilDateTime
Source§impl Debug for FluentCivilDateTime
impl Debug for FluentCivilDateTime
Source§impl PartialEq for FluentCivilDateTime
impl PartialEq for FluentCivilDateTime
Source§impl Res<FluentCivilDateTime> for FluentCivilDateTime
impl Res<FluentCivilDateTime> for FluentCivilDateTime
Source§fn get_value(&self, _: &impl DataContext) -> FluentCivilDateTime
fn get_value(&self, _: &impl DataContext) -> FluentCivilDateTime
Returns the value of a resource by value.
fn set_or_bind<F>(self, cx: &mut Context, closure: F)
Source§impl Res<FluentCivilDateTime> for DateTime
impl Res<FluentCivilDateTime> for DateTime
Source§fn get_value(&self, _: &impl DataContext) -> FluentCivilDateTime
fn get_value(&self, _: &impl DataContext) -> FluentCivilDateTime
Returns the value of a resource by value.
fn set_or_bind<F>(self, cx: &mut Context, closure: F)
impl StructuralPartialEq for FluentCivilDateTime
Auto Trait Implementations§
impl Freeze for FluentCivilDateTime
impl RefUnwindSafe for FluentCivilDateTime
impl Send for FluentCivilDateTime
impl Sync for FluentCivilDateTime
impl Unpin for FluentCivilDateTime
impl UnsafeUnpin for FluentCivilDateTime
impl UnwindSafe for FluentCivilDateTime
Blanket Implementations§
§impl<T> AnyEq for T
impl<T> AnyEq for T
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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.