pub struct TimeFormatterBuilder { /* private fields */ }Expand description
Builder for creating time formatters
Implementations§
Source§impl TimeFormatterBuilder
impl TimeFormatterBuilder
Sourcepub fn with_24_hour(self, use_24_hour: bool) -> Self
pub fn with_24_hour(self, use_24_hour: bool) -> Self
Set 24-hour format
Sourcepub fn with_seconds(self, show_seconds: bool) -> Self
pub fn with_seconds(self, show_seconds: bool) -> Self
Set seconds display
Sourcepub fn with_time_visible(self, time_visible: bool) -> Self
pub fn with_time_visible(self, time_visible: bool) -> Self
Show the clock in intraday marks and hover labels, or dates alone.
Sourcepub fn with_locale(self, locale: impl Into<String>) -> Self
pub fn with_locale(self, locale: impl Into<String>) -> Self
Set locale
Sourcepub fn with_date_format(self, date_format: impl Into<String>) -> Self
pub fn with_date_format(self, date_format: impl Into<String>) -> Self
Set the strftime pattern for crosshair and tooltip dates; see
DefaultTimeFormatter::date_format.
Sourcepub fn with_formatter(self, formatter: Box<dyn TimeFormatter>) -> Self
pub fn with_formatter(self, formatter: Box<dyn TimeFormatter>) -> Self
Format with formatter, with per-tick access to the locale and default text.
The time zone and clock visibility still apply: formatter receives
wall-clock times in the chosen zone, and dates in place of intraday
clocks when the time is hidden. Its own options replace the 24-hour,
seconds, locale and date format settings, unless
format_tick returns None for a tick.
Sourcepub fn with_timezone(self, timezone: TimezoneMode) -> Self
pub fn with_timezone(self, timezone: TimezoneMode) -> Self
Set timezone for conversion
Sourcepub fn build(self) -> Box<dyn TimeFormatter>
pub fn build(self) -> Box<dyn TimeFormatter>
Build the formatter
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for TimeFormatterBuilder
impl !UnwindSafe for TimeFormatterBuilder
impl Freeze for TimeFormatterBuilder
impl Send for TimeFormatterBuilder
impl Sync for TimeFormatterBuilder
impl Unpin for TimeFormatterBuilder
impl UnsafeUnpin for TimeFormatterBuilder
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> 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