Offset

Struct 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 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 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 duplicate 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

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

Auto Trait Implementations§

§

impl Freeze for Offset

§

impl RefUnwindSafe for Offset

§

impl Send for Offset

§

impl Sync for Offset

§

impl Unpin for Offset

§

impl UnwindSafe for Offset

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, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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.