jiff::fmt::temporal

Enum TimeZoneAnnotationKind

Source
#[non_exhaustive]
pub enum TimeZoneAnnotationKind<'n> { Named(TimeZoneAnnotationName<'n>), Offset(Offset), }
Expand description

The kind of time zone found in an RFC 9557 timestamp, for use with Pieces.

The lifetime parameter refers to the lifetime of the time zone name. The lifetime is static when the time zone annotation is offset or if the name is owned. An owned value can be produced via TimeZoneAnnotation::into_owned when the alloc crate feature is enabled.

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.
§

Named(TimeZoneAnnotationName<'n>)

The time zone annotation is a name, usually an IANA time zone identifier. For example, America/New_York.

§

Offset(Offset)

The time zone annotation is an offset. For example, -05:00.

Implementations§

Source§

impl<'n> TimeZoneAnnotationKind<'n>

Source

pub fn into_owned(self) -> TimeZoneAnnotationKind<'static>

Converts this time zone annotation kind into an “owned” value whose lifetime is 'static.

If this was already an “owned” value or a time zone annotation offset, then this is a no-op.

Trait Implementations§

Source§

impl<'n> Clone for TimeZoneAnnotationKind<'n>

Source§

fn clone(&self) -> TimeZoneAnnotationKind<'n>

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<'n> Debug for TimeZoneAnnotationKind<'n>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'n> From<&'n str> for TimeZoneAnnotationKind<'n>

Source§

fn from(string: &'n str) -> TimeZoneAnnotationKind<'n>

Converts to this type from the input type.
Source§

impl From<Offset> for TimeZoneAnnotationKind<'static>

Source§

fn from(offset: Offset) -> TimeZoneAnnotationKind<'static>

Converts to this type from the input type.
Source§

impl<'n> Hash for TimeZoneAnnotationKind<'n>

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl<'n> PartialEq for TimeZoneAnnotationKind<'n>

Source§

fn eq(&self, other: &TimeZoneAnnotationKind<'n>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<'n> Eq for TimeZoneAnnotationKind<'n>

Source§

impl<'n> StructuralPartialEq for TimeZoneAnnotationKind<'n>

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dst: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.