#[non_exhaustive]pub enum TimezoneSource {
Local,
Utc,
Named(Tz),
}Expand description
Resolved timezone source. Built once at startup; used for every per-line
render. #[non_exhaustive] so a future variant (e.g., explicit FixedOffset)
can be added in minor releases.
§Example
use rusty_ts::TimezoneSource;
// Three ways to construct a timezone source:
let local = TimezoneSource::Local;
let utc = TimezoneSource::Utc;
let tokyo = TimezoneSource::named("Asia/Tokyo").expect("valid IANA");
// Unknown IANA names return Error::InvalidIanaName.
assert!(TimezoneSource::named("Atlantis/Atlantica").is_err());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.
Local
System local time as adjusted by the TZ env var if set.
Utc
UTC (no offset, no DST).
Named(Tz)
A named IANA zone.
Implementations§
Trait Implementations§
Source§impl Clone for TimezoneSource
impl Clone for TimezoneSource
Source§fn clone(&self) -> TimezoneSource
fn clone(&self) -> TimezoneSource
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 moreAuto Trait Implementations§
impl Freeze for TimezoneSource
impl RefUnwindSafe for TimezoneSource
impl Send for TimezoneSource
impl Sync for TimezoneSource
impl Unpin for TimezoneSource
impl UnsafeUnpin for TimezoneSource
impl UnwindSafe for TimezoneSource
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