Struct greg_tz::Offset

source ·
pub struct Offset { /* private fields */ }
Expand description

A Steady (i.e. fixed) offset from UTC

There is a handful of timezones in the IANA database that are always at the same offset (i.e. no DST, no time zone transitions ever), and these are implemented as associated constants here. Most of these are fixed “by definition”, that is their name literally is Etc/GMTPlus3 or something to that effect – these are unlikely to ever change between versions of the database. However, for the time zones where that is not immediately obvious, a word of caution: if any of these, according to the timezone database, cease being fixed offsets, the associated constants will be removed unceremoniously from the next version of this library. As such, no semantic versioning guarantees can be made about these constants. Finally, as a reminder: the timezone database reflects the arbitrary and frequently insane decisions made by politicians.

Implementations§

source§

impl Offset

source

pub const EST: Self = _

EST

source

pub const Etc__GMT: Self = _

Etc/GMT

source

pub const Etc__GMTPlus0: Self = Self::Etc__GMT

Etc/GMT+0 (an alias for Etc/GMT)

source

pub const Etc__GMTPlus1: Self = _

Etc/GMT+1

source

pub const Etc__GMTPlus10: Self = _

Etc/GMT+10

source

pub const Etc__GMTPlus11: Self = _

Etc/GMT+11

source

pub const Etc__GMTPlus12: Self = _

Etc/GMT+12

source

pub const Etc__GMTPlus2: Self = _

Etc/GMT+2

source

pub const Etc__GMTPlus3: Self = _

Etc/GMT+3

source

pub const Etc__GMTPlus4: Self = _

Etc/GMT+4

source

pub const Etc__GMTPlus5: Self = _

Etc/GMT+5

source

pub const Etc__GMTPlus6: Self = _

Etc/GMT+6

source

pub const Etc__GMTPlus7: Self = _

Etc/GMT+7

source

pub const Etc__GMTPlus8: Self = _

Etc/GMT+8

source

pub const Etc__GMTPlus9: Self = _

Etc/GMT+9

source

pub const Etc__GMTMinus0: Self = Self::Etc__GMT

Etc/GMT-0 (an alias for Etc/GMT)

source

pub const Etc__GMTMinus1: Self = _

Etc/GMT-1

source

pub const Etc__GMTMinus10: Self = _

Etc/GMT-10

source

pub const Etc__GMTMinus11: Self = _

Etc/GMT-11

source

pub const Etc__GMTMinus12: Self = _

Etc/GMT-12

source

pub const Etc__GMTMinus13: Self = _

Etc/GMT-13

source

pub const Etc__GMTMinus14: Self = _

Etc/GMT-14

source

pub const Etc__GMTMinus2: Self = _

Etc/GMT-2

source

pub const Etc__GMTMinus3: Self = _

Etc/GMT-3

source

pub const Etc__GMTMinus4: Self = _

Etc/GMT-4

source

pub const Etc__GMTMinus5: Self = _

Etc/GMT-5

source

pub const Etc__GMTMinus6: Self = _

Etc/GMT-6

source

pub const Etc__GMTMinus7: Self = _

Etc/GMT-7

source

pub const Etc__GMTMinus8: Self = _

Etc/GMT-8

source

pub const Etc__GMTMinus9: Self = _

Etc/GMT-9

source

pub const Etc__GMT0: Self = Self::Etc__GMT

Etc/GMT0 (an alias for Etc/GMT)

source

pub const Etc__Greenwich: Self = Self::Etc__GMT

Etc/Greenwich (an alias for Etc/GMT)

source

pub const Etc__UCT: Self = Self::Etc__UTC

Etc/UCT (an alias for Etc/UTC)

source

pub const Etc__UTC: Self = _

Etc/UTC

source

pub const Etc__Universal: Self = Self::Etc__UTC

Etc/Universal (an alias for Etc/UTC)

source

pub const Etc__Zulu: Self = Self::Etc__UTC

Etc/Zulu (an alias for Etc/UTC)

source

pub const GMT: Self = Self::Etc__GMT

GMT (an alias for Etc/GMT)

source

pub const GMTPlus0: Self = Self::Etc__GMT

GMT+0 (an alias for Etc/GMT)

source

pub const GMTMinus0: Self = Self::Etc__GMT

GMT-0 (an alias for Etc/GMT)

source

pub const GMT0: Self = Self::Etc__GMT

GMT0 (an alias for Etc/GMT)

source

pub const Greenwich: Self = Self::Etc__GMT

Greenwich (an alias for Etc/GMT)

source

pub const HST: Self = _

HST

source

pub const MST: Self = _

MST

source

pub const UCT: Self = Self::Etc__UTC

UCT (an alias for Etc/UTC)

source

pub const UTC: Self = Self::Etc__UTC

UTC (an alias for Etc/UTC)

source

pub const Universal: Self = Self::Etc__UTC

Universal (an alias for Etc/UTC)

source

pub const Zulu: Self = Self::Etc__UTC

Zulu (an alias for Etc/UTC)

source§

impl Offset

source

pub const fn name(self) -> &'static str

Name of the Offset (e.g. CEST)

Trait Implementations§

source§

impl Clone for Offset

source§

fn clone(&self) -> Offset

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 Debug for Offset

source§

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

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

impl PartialEq for Offset

source§

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

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Shift for Offset

source§

fn apply(&self, point: Point) -> Point

Apply the offset Read more
source§

impl Steady for Offset

source§

fn revert(&self, point: Point) -> Point

Revert the offset as (would be) applied by Shift::apply Read more
source§

impl Copy for Offset

source§

impl Eq for Offset

source§

impl StructuralEq for Offset

source§

impl StructuralPartialEq for Offset

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> 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,

§

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>,

§

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>,

§

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.