pub struct Timezone { /* private fields */ }Expand description
A timezone. It can have a varying offset, like Europe/London, or fixed like GMT+1.
Implementations§
Source§impl Timezone
impl Timezone
pub const UTC: Self
pub const GMT: Self
pub const GMT_MINUS_1: Self
pub const GMT_MINUS_2: Self
pub const GMT_MINUS_3: Self
pub const GMT_MINUS_4: Self
pub const GMT_MINUS_5: Self
pub const GMT_MINUS_6: Self
pub const GMT_MINUS_7: Self
pub const GMT_MINUS_8: Self
pub const GMT_MINUS_9: Self
pub const GMT_MINUS_10: Self
pub const GMT_MINUS_11: Self
pub const GMT_MINUS_12: Self
pub const GMT_PLUS_1: Self
pub const GMT_PLUS_2: Self
pub const GMT_PLUS_3: Self
pub const GMT_PLUS_4: Self
pub const GMT_PLUS_5: Self
pub const GMT_PLUS_6: Self
pub const GMT_PLUS_7: Self
pub const GMT_PLUS_8: Self
pub const GMT_PLUS_9: Self
pub const GMT_PLUS_10: Self
pub const GMT_PLUS_11: Self
pub const GMT_PLUS_12: Self
pub const GMT_PLUS_13: Self
pub const GMT_PLUS_14: Self
Sourcepub fn from_name(name: &str) -> Option<Self>
pub fn from_name(name: &str) -> Option<Self>
Create a new Timezone from a name in the IANA Database.
Sourcepub fn as_name(&self) -> Option<&'static str>
pub fn as_name(&self) -> Option<&'static str>
Get the name of the timezone as in the IANA Database. It might differ from (although still be equivalent to) the name given to from_name.
Sourcepub fn from_offset(seconds: i32) -> Option<Self>
pub fn from_offset(seconds: i32) -> Option<Self>
Makes a new Timezone for the Eastern Hemisphere with given timezone difference. The negative seconds means the Western Hemisphere.
Sourcepub fn as_offset(&self) -> Option<i32>
pub fn as_offset(&self) -> Option<i32>
Returns the number of seconds to add to convert from UTC to the local time.
Sourcepub fn as_offset_at(&self, utc_date_time: &DateTime) -> i32
pub fn as_offset_at(&self, utc_date_time: &DateTime) -> i32
Returns the number of seconds to add to convert from UTC to the local time.
Trait Implementations§
Source§impl AmadeusOrd for Timezone
impl AmadeusOrd for Timezone
fn amadeus_cmp(&self, other: &Self) -> Ordering
Source§impl<'de> Deserialize<'de> for Timezone
impl<'de> Deserialize<'de> for Timezone
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl DowncastFrom<Value> for Timezone
impl DowncastFrom<Value> for Timezone
fn downcast_from(self_: Value) -> Result<Self, DowncastError>
Source§impl Ord for Timezone
impl Ord for Timezone
Source§impl PartialOrd for Timezone
impl PartialOrd for Timezone
impl Copy for Timezone
impl Eq for Timezone
impl StructuralPartialEq for Timezone
Auto Trait Implementations§
impl Freeze for Timezone
impl RefUnwindSafe for Timezone
impl Send for Timezone
impl Sync for Timezone
impl Unpin for Timezone
impl UnwindSafe for Timezone
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<A, B> Downcast<A> for Bwhere
A: DowncastFrom<B>,
impl<A, B> Downcast<A> for Bwhere
A: DowncastFrom<B>,
fn downcast(self) -> Result<A, DowncastError>
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<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