pub struct Zone(/* private fields */);Expand description
A time zone: UTC, a fixed offset or an IANA zone (with its daylight
saving rules). Made by parsing ("Asia/Jakarta".parse::<Zone>(),
"+07:00".parse()), or Zone::UTC and Zone::fixed.
Implementations§
Source§impl Zone
impl Zone
Sourcepub const fn fixed(seconds: i32) -> Zone
pub const fn fixed(seconds: i32) -> Zone
A fixed offset from UTC, in seconds east (Zone::fixed(7 * 3600) is
+07:00), with no daylight saving time.
Sourcepub fn offset_at(&self, unix: i64) -> i64
pub fn offset_at(&self, unix: i64) -> i64
The offset from UTC at the moment unix (seconds), in seconds.
Sourcepub fn local(&self, unix: i64) -> NaiveDateTime
pub fn local(&self, unix: i64) -> NaiveDateTime
The wall-clock time at the moment unix.
Sourcepub fn resolve(&self, local: NaiveDateTime) -> Option<i64>
pub fn resolve(&self, local: NaiveDateTime) -> Option<i64>
The moment a wall-clock time happens. In the hour clocks skip in
spring it doesn’t (None); in the hour repeated in autumn it’s the
first one.
Sourcepub fn fixed_at(&self, unix: i64) -> FixedOffset
pub fn fixed_at(&self, unix: i64) -> FixedOffset
The fixed offset in effect at unix, for chrono’s formatting.
Trait Implementations§
impl Copy for Zone
impl Eq for Zone
impl StructuralPartialEq for Zone
Auto Trait Implementations§
impl Freeze for Zone
impl RefUnwindSafe for Zone
impl Send for Zone
impl Sync for Zone
impl Unpin for Zone
impl UnsafeUnpin for Zone
impl UnwindSafe for Zone
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more