Struct OffsetInfo

pub struct OffsetInfo { /* private fields */ }

Information associated with an offset when doing a time zone transition lookup.

Callers should generally only need the offset. This exposes additional information such as the time zone abbreviation or whether a timestamp is in daylight saving time or not.

Implementations

impl OffsetInfo

fn offset(&self) -> Offset

Returns the offset corresponding to this time zone transition. All instants at and following this transition's timestamp (and before the next transition's timestamp) need to apply this offset from UTC to get the civil or "local" time in the corresponding time zone.

fn abbreviation(&self) -> &Abbreviation

Returns the time zone abbreviation corresponding to this time zone transition.

fn into_abbreviation(self) -> Abbreviation

Consumes this offset info and returns its abbreviation.

fn dst(&self) -> Dst

Returns whether daylight saving time is enabled for this time zone transition.

Trait Implementations

impl Clone for OffsetInfo

fn clone(&self) -> OffsetInfo

impl Debug for OffsetInfo

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

impl Eq for OffsetInfo

impl Hash for OffsetInfo

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

impl PartialEq for OffsetInfo

fn eq(&self, other: &OffsetInfo) -> bool

impl StructuralPartialEq for OffsetInfo

Auto Trait Implementations

impl Freeze for OffsetInfo

impl RefUnwindSafe for OffsetInfo

impl Send for OffsetInfo

impl Sync for OffsetInfo

impl Unpin for OffsetInfo

impl UnsafeUnpin for OffsetInfo

impl UnwindSafe for OffsetInfo

Blanket Implementations

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

fn type_id(&self) -> TypeId

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

fn borrow(&self) -> &T

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

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

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

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

impl<T> From<T> for OffsetInfo

fn from(t: T) -> T

Returns the argument unchanged.

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

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

impl<T, U> Into<U> for OffsetInfo 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 OffsetInfo 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 OffsetInfo where U: TryFrom<T>,

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