Struct MaybeNamedTimeZone
pub struct MaybeNamedTimeZone { pub name: Option<TimeZoneId>, pub tz: TimeZone }
A representation of a possibly named time zone backed by TZif data.
It is useful to represent a named time zone as distinct from the time zone itself because a name is not inherently part of the TZif data. Indeed, there are a couple reasons why it's important to separate the name:
- It's possible that no meaningful name exists. For example, a
/etc/localtimefile with no obvious mapping to a name. (e.g., No symlink and no discoverable Time Zone Database.) - Some IANA time zone identifiers correspond to different regions, but share the same TZif data.
Fields
name: Option<TimeZoneId>The name of this TZif time zone. e.g.,
America/New_York.tz: TimeZoneThe time zone itself.
Implementations
impl MaybeNamedTimeZone
fn name(&self) -> Option<&str>Returns the underlying time zone name as a string.
fn tz(&self) -> &TimeZoneReturns a reference to the underlying time zone definition.
Trait Implementations
impl Clone for MaybeNamedTimeZone
fn clone(&self) -> MaybeNamedTimeZone
impl Debug for MaybeNamedTimeZone
fn fmt(&self, f: &mut Formatter<'_>) -> Result
impl PartialEq for MaybeNamedTimeZone
fn eq(&self, other: &MaybeNamedTimeZone) -> bool
impl StructuralPartialEq for MaybeNamedTimeZone
Auto Trait Implementations
impl Freeze for MaybeNamedTimeZone
impl RefUnwindSafe for MaybeNamedTimeZone
impl Send for MaybeNamedTimeZone
impl Sync for MaybeNamedTimeZone
impl Unpin for MaybeNamedTimeZone
impl UnsafeUnpin for MaybeNamedTimeZone
impl UnwindSafe for MaybeNamedTimeZone
Blanket Implementations
impl<T> Any for MaybeNamedTimeZone
where
T: 'static + ?Sized,
fn type_id(&self) -> TypeId
impl<T> Borrow<T> for MaybeNamedTimeZone
where
T: ?Sized,
fn borrow(&self) -> &T
impl<T> BorrowMut<T> for MaybeNamedTimeZone
where
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
impl<T> CloneToUninit for MaybeNamedTimeZone
where
T: Clone,
unsafe fn clone_to_uninit(&self, dest: *mut u8)
impl<T> From<T> for MaybeNamedTimeZone
fn from(t: T) -> TReturns the argument unchanged.
impl<T> ToOwned for MaybeNamedTimeZone
where
T: Clone,
type Owned = T;fn to_owned(&self) -> Tfn clone_into(&self, target: &mut T)
impl<T, U> Into<U> for MaybeNamedTimeZone
where
U: From<T>,
fn into(self) -> UCalls
U::from(self).That is, this conversion is whatever the implementation of
[From]<T> for Uchooses to do.
impl<T, U> TryFrom<U> for MaybeNamedTimeZone
where
U: Into<T>,
type Error = Infallible;fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
impl<T, U> TryInto<U> for MaybeNamedTimeZone
where
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error;fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>