#[non_exhaustive]pub enum Format {
Default,
Strftime(String),
}Expand description
Strftime format selector for TimestamperBuilder. #[non_exhaustive] so
future variants (e.g., a precompiled format) can be added in minor
releases without breaking semver.
§Example
use rusty_ts::{Format, TimestamperBuilder};
// Use the moreutils default format.
let ts = TimestamperBuilder::new()
.format(Format::Default)
.build()
.unwrap();
// Use a custom strftime spec, including moreutils fractional extensions.
let ts = TimestamperBuilder::new()
.format(Format::Strftime("%Y-%m-%d %H:%M:%.S".into()))
.build()
.unwrap();Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Default
Use the moreutils default format (%b %d %H:%M:%S).
Strftime(String)
Use the supplied strftime spec, including %.S / %.s fractional
extensions.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Format
impl RefUnwindSafe for Format
impl Send for Format
impl Sync for Format
impl Unpin for Format
impl UnsafeUnpin for Format
impl UnwindSafe for Format
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