#[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>
impl<'n> TimeZoneAnnotationKind<'n>
Sourcepub fn into_owned(self) -> TimeZoneAnnotationKind<'static>
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>
impl<'n> Clone for TimeZoneAnnotationKind<'n>
Source§fn clone(&self) -> TimeZoneAnnotationKind<'n>
fn clone(&self) -> TimeZoneAnnotationKind<'n>
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl<'n> Debug for TimeZoneAnnotationKind<'n>
impl<'n> Debug for TimeZoneAnnotationKind<'n>
Source§impl<'n> From<&'n str> for TimeZoneAnnotationKind<'n>
impl<'n> From<&'n str> for TimeZoneAnnotationKind<'n>
Source§fn from(string: &'n str) -> TimeZoneAnnotationKind<'n>
fn from(string: &'n str) -> TimeZoneAnnotationKind<'n>
Converts to this type from the input type.
Source§impl From<Offset> for TimeZoneAnnotationKind<'static>
impl From<Offset> for TimeZoneAnnotationKind<'static>
Source§fn from(offset: Offset) -> TimeZoneAnnotationKind<'static>
fn from(offset: Offset) -> TimeZoneAnnotationKind<'static>
Converts to this type from the input type.
Source§impl<'n> Hash for TimeZoneAnnotationKind<'n>
impl<'n> Hash for TimeZoneAnnotationKind<'n>
Source§impl<'n> PartialEq for TimeZoneAnnotationKind<'n>
impl<'n> PartialEq for TimeZoneAnnotationKind<'n>
impl<'n> Eq for TimeZoneAnnotationKind<'n>
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> UnwindSafe for TimeZoneAnnotationKind<'n>
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