pub struct TimezoneOffset { /* private fields */ }
Expand description
A timezone offset with respect to UTC.
It is encoded as a number of minutes between -PT14H and PT14H.
Implementations§
Source§impl TimezoneOffset
impl TimezoneOffset
pub const MAX: TimezoneOffset
pub const MIN: TimezoneOffset
pub const UTC: TimezoneOffset
Sourcepub fn new(
offset_in_minutes: i16,
) -> Result<TimezoneOffset, InvalidTimezoneError>
pub fn new( offset_in_minutes: i16, ) -> Result<TimezoneOffset, InvalidTimezoneError>
From offset in minute with respect to UTC
Sourcepub fn new_unchecked(offset_in_minutes: i16) -> TimezoneOffset
pub fn new_unchecked(offset_in_minutes: i16) -> TimezoneOffset
From offset in minute with respect to UTC
pub fn from_be_bytes(bytes: [u8; 2]) -> TimezoneOffset
pub fn to_be_bytes(self) -> [u8; 2]
Sourcepub fn in_minutes(self) -> i16
pub fn in_minutes(self) -> i16
Returns the offset in minutes with respect to UTC.
Trait Implementations§
Source§impl Clone for TimezoneOffset
impl Clone for TimezoneOffset
Source§fn clone(&self) -> TimezoneOffset
fn clone(&self) -> TimezoneOffset
Returns a duplicate 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 Debug for TimezoneOffset
impl Debug for TimezoneOffset
Source§impl Display for TimezoneOffset
impl Display for TimezoneOffset
Source§impl From<TimezoneOffset> for DayTimeDuration
impl From<TimezoneOffset> for DayTimeDuration
Source§fn from(value: TimezoneOffset) -> DayTimeDuration
fn from(value: TimezoneOffset) -> DayTimeDuration
Converts to this type from the input type.
Source§impl From<TimezoneOffset> for Duration
impl From<TimezoneOffset> for Duration
Source§fn from(value: TimezoneOffset) -> Duration
fn from(value: TimezoneOffset) -> Duration
Converts to this type from the input type.
Source§impl Hash for TimezoneOffset
impl Hash for TimezoneOffset
Source§impl Ord for TimezoneOffset
impl Ord for TimezoneOffset
Source§fn cmp(&self, other: &TimezoneOffset) -> Ordering
fn cmp(&self, other: &TimezoneOffset) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for TimezoneOffset
impl PartialEq for TimezoneOffset
Source§impl PartialOrd for TimezoneOffset
impl PartialOrd for TimezoneOffset
Source§impl TryFrom<DayTimeDuration> for TimezoneOffset
impl TryFrom<DayTimeDuration> for TimezoneOffset
Source§type Error = InvalidTimezoneError
type Error = InvalidTimezoneError
The type returned in the event of a conversion error.
Source§fn try_from(
value: DayTimeDuration,
) -> Result<TimezoneOffset, <TimezoneOffset as TryFrom<DayTimeDuration>>::Error>
fn try_from( value: DayTimeDuration, ) -> Result<TimezoneOffset, <TimezoneOffset as TryFrom<DayTimeDuration>>::Error>
Performs the conversion.
Source§impl TryFrom<Duration> for TimezoneOffset
impl TryFrom<Duration> for TimezoneOffset
Source§type Error = InvalidTimezoneError
type Error = InvalidTimezoneError
The type returned in the event of a conversion error.
Source§fn try_from(
value: Duration,
) -> Result<TimezoneOffset, <TimezoneOffset as TryFrom<Duration>>::Error>
fn try_from( value: Duration, ) -> Result<TimezoneOffset, <TimezoneOffset as TryFrom<Duration>>::Error>
Performs the conversion.
impl Copy for TimezoneOffset
impl Eq for TimezoneOffset
impl StructuralPartialEq for TimezoneOffset
Auto Trait Implementations§
impl Freeze for TimezoneOffset
impl RefUnwindSafe for TimezoneOffset
impl Send for TimezoneOffset
impl Sync for TimezoneOffset
impl Unpin for TimezoneOffset
impl UnwindSafe for TimezoneOffset
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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
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