pub struct DefaultTimeFormatter {
pub use_24_hour: bool,
pub show_seconds: bool,
pub date_format: Option<String>,
}Expand description
Default time formatter using standard formats
Fields§
§use_24_hour: boolWhether to use 24-hour format
show_seconds: boolWhether to show seconds
date_format: Option<String>strftime pattern for the date in crosshair and tooltip labels, such as
"%d.%m.%Y", followed by the clock for intraday bars. None uses the
built-in dates; an invalid pattern falls back to them.
Trait Implementations§
Source§impl Clone for DefaultTimeFormatter
impl Clone for DefaultTimeFormatter
Source§fn clone(&self) -> DefaultTimeFormatter
fn clone(&self) -> DefaultTimeFormatter
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 DefaultTimeFormatter
impl Debug for DefaultTimeFormatter
Source§impl Default for DefaultTimeFormatter
impl Default for DefaultTimeFormatter
Source§impl TimeFormatter for DefaultTimeFormatter
impl TimeFormatter for DefaultTimeFormatter
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 format_crosshair(&self, time: DateTime<Utc>, bar_seconds: i64) -> String
fn format_crosshair(&self, time: DateTime<Utc>, bar_seconds: i64) -> String
Formats the hovered bar, retaining this formatter’s date and clock conventions.
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 DefaultTimeFormatter
impl RefUnwindSafe for DefaultTimeFormatter
impl Send for DefaultTimeFormatter
impl Sync for DefaultTimeFormatter
impl Unpin for DefaultTimeFormatter
impl UnsafeUnpin for DefaultTimeFormatter
impl UnwindSafe for DefaultTimeFormatter
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