Struct fluent_datetime::FluentDateTime
source · 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
fn duplicate(&self) -> Box<dyn FluentType + Send>
fn as_string(&self, intls: &IntlLangMemoizer) -> Cow<'static, str>
fn as_string_threadsafe(&self, intls: &IntlLangMemoizer) -> Cow<'static, str>
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
source§fn eq(&self, other: &FluentDateTime) -> bool
fn eq(&self, other: &FluentDateTime) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl StructuralPartialEq for FluentDateTime
Auto Trait Implementations§
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