pub struct RelativeTimeFormatter {
pub reference_time: DateTime<Utc>,
}Expand description
Relative time formatter (e.g., “2h ago”, “yesterday”)
Fields§
§reference_time: DateTime<Utc>Reference time for relative calculations (usually “now”)
Implementations§
Trait Implementations§
Source§impl Clone for RelativeTimeFormatter
impl Clone for RelativeTimeFormatter
Source§fn clone(&self) -> RelativeTimeFormatter
fn clone(&self) -> RelativeTimeFormatter
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 moreSource§impl Debug for RelativeTimeFormatter
impl Debug for RelativeTimeFormatter
Source§impl TimeFormatter for RelativeTimeFormatter
impl TimeFormatter for RelativeTimeFormatter
Source§fn format(&self, time: DateTime<Utc>, _mark_type: TickMarkType) -> String
fn format(&self, time: DateTime<Utc>, _mark_type: TickMarkType) -> String
Format a ts into a display string Read more
Source§fn clone_box(&self) -> Box<dyn TimeFormatter>
fn clone_box(&self) -> Box<dyn TimeFormatter>
Clone this formatter into a Box
Source§fn format_tick(&self, context: TickMarkContext<'_>) -> Option<String>
fn format_tick(&self, context: TickMarkContext<'_>) -> Option<String>
Formats one axis tick with the active chart locale and display-time fields. Read more
Source§fn wall_time(&self, time: DateTime<Utc>) -> DateTime<Utc>
fn wall_time(&self, time: DateTime<Utc>) -> DateTime<Utc>
Clock-face time used to identify calendar boundaries. The returned UTC value
holds local fields, not another instant.
Source§fn utc_time(&self, wall_time: DateTime<Utc>) -> Option<DateTime<Utc>>
fn utc_time(&self, wall_time: DateTime<Utc>) -> Option<DateTime<Utc>>
Converts local calendar fields from
wall_time back to an instant.
Repeated times use the first instant; skipped times use the clock jump.Source§fn time_visible(&self) -> bool
fn time_visible(&self) -> bool
Whether intraday marks and hover labels include the clock.
Auto Trait Implementations§
impl Freeze for RelativeTimeFormatter
impl RefUnwindSafe for RelativeTimeFormatter
impl Send for RelativeTimeFormatter
impl Sync for RelativeTimeFormatter
impl Unpin for RelativeTimeFormatter
impl UnsafeUnpin for RelativeTimeFormatter
impl UnwindSafe for RelativeTimeFormatter
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
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,
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