Enum TimeZoneAnnotationKind

#[non_exhaustive]
pub enum TimeZoneAnnotationKind<'n>

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

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

impl<'n> TimeZoneAnnotationKind<'n>

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

impl From<Offset> for TimeZoneAnnotationKind<'static>

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

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

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

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

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

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

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

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

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

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

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

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

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

Auto Trait Implementations

impl<'n> Freeze for TimeZoneAnnotationKind<'n>

impl<'n> RefUnwindSafe for TimeZoneAnnotationKind<'n>

impl<'n> Send for TimeZoneAnnotationKind<'n>

impl<'n> Sync for TimeZoneAnnotationKind<'n>

impl<'n> Unpin for TimeZoneAnnotationKind<'n>

impl<'n> UnsafeUnpin for TimeZoneAnnotationKind<'n>

impl<'n> UnwindSafe for TimeZoneAnnotationKind<'n>

Blanket Implementations

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

fn type_id(&self) -> TypeId

impl<T> Borrow<T> for TimeZoneAnnotationKind<'n> where T: ?Sized,

fn borrow(&self) -> &T

impl<T> BorrowMut<T> for TimeZoneAnnotationKind<'n> where T: ?Sized,

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

impl<T> CloneToUninit for TimeZoneAnnotationKind<'n> where T: Clone,

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

impl<T> From<T> for TimeZoneAnnotationKind<'n>

fn from(t: T) -> T

Returns the argument unchanged.

impl<T> ToOwned for TimeZoneAnnotationKind<'n> where T: Clone,

type Owned = T;
fn to_owned(&self) -> T
fn clone_into(&self, target: &mut T)

impl<T, U> Into<U> for TimeZoneAnnotationKind<'n> where U: From<T>,

fn into(self) -> U

Calls U::from(self).

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

impl<T, U> TryFrom<U> for TimeZoneAnnotationKind<'n> where U: Into<T>,

type Error = never;
fn try_from(value: U) -> Result<T, never>

impl<T, U> TryInto<U> for TimeZoneAnnotationKind<'n> where U: TryFrom<T>,

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