pub struct TimeZoneInfo<Model>where
Model: TimeZoneModel,{ /* private fields */ }
Expand description
A utility type that can hold time zone information.
Implementations§
Source§impl<Model> TimeZoneInfo<Model>where
Model: TimeZoneModel,
impl<Model> TimeZoneInfo<Model>where
Model: TimeZoneModel,
Source§impl<Model> TimeZoneInfo<Model>
impl<Model> TimeZoneInfo<Model>
Sourcepub fn local_time(self) -> (Date<Iso>, Time)
pub fn local_time(self) -> (Date<Iso>, Time)
The time at which to interpret the time zone.
Source§impl<Model> TimeZoneInfo<Model>where
Model: TimeZoneModel<TimeZoneVariant = TimeZoneVariant>,
impl<Model> TimeZoneInfo<Model>where
Model: TimeZoneModel<TimeZoneVariant = TimeZoneVariant>,
Sourcepub fn zone_variant(self) -> TimeZoneVariant
pub fn zone_variant(self) -> TimeZoneVariant
The time variant e.g. daylight or standard, if known.
This field is not enforced to be consistent with the time zone id and offset.
Source§impl TimeZoneInfo<Base>
impl TimeZoneInfo<Base>
Sourcepub const fn unknown() -> TimeZoneInfo<Base>
pub const fn unknown() -> TimeZoneInfo<Base>
Creates a time zone info with no information.
Sourcepub const fn utc() -> TimeZoneInfo<Base>
pub const fn utc() -> TimeZoneInfo<Base>
Creates a new TimeZoneInfo
for the UTC time zone.
Source§impl TimeZoneInfo<AtTime>
impl TimeZoneInfo<AtTime>
Sourcepub const fn with_zone_variant(
self,
zone_variant: TimeZoneVariant,
) -> TimeZoneInfo<Full>
pub const fn with_zone_variant( self, zone_variant: TimeZoneVariant, ) -> TimeZoneInfo<Full>
Sets a zone variant on this time zone.
Sourcepub fn infer_zone_variant(
self,
calculator: VariantOffsetsCalculatorBorrowed<'_>,
) -> TimeZoneInfo<Full>
pub fn infer_zone_variant( self, calculator: VariantOffsetsCalculatorBorrowed<'_>, ) -> TimeZoneInfo<Full>
Sets the zone variant by calculating it using a VariantOffsetsCalculator
.
If offset()
is None
, or if it doesn’t match either of the
timezone’s standard or daylight offset around local_time()
,
the variant will be set to TimeZoneVariant::Standard
and the time zone
to TimeZone::unknown()
.
Trait Implementations§
Source§impl<Model> Clone for TimeZoneInfo<Model>where
Model: TimeZoneModel,
impl<Model> Clone for TimeZoneInfo<Model>where
Model: TimeZoneModel,
Source§fn clone(&self) -> TimeZoneInfo<Model>
fn clone(&self) -> TimeZoneInfo<Model>
Returns a copy 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<O> ConvertCalendar for TimeZoneInfo<O>where
O: TimeZoneModel,
impl<O> ConvertCalendar for TimeZoneInfo<O>where
O: TimeZoneModel,
Source§type Converted<'a> = TimeZoneInfo<O>
type Converted<'a> = TimeZoneInfo<O>
The converted type. This can be the same as the receiver type.
Source§fn to_calendar<'a>(
&self,
_: &'a AnyCalendar,
) -> <TimeZoneInfo<O> as ConvertCalendar>::Converted<'a>
fn to_calendar<'a>( &self, _: &'a AnyCalendar, ) -> <TimeZoneInfo<O> as ConvertCalendar>::Converted<'a>
Converts
self
to the specified AnyCalendar
.Source§impl<Model> Debug for TimeZoneInfo<Model>where
Model: Debug + TimeZoneModel,
<Model as TimeZoneModel>::LocalTime: Debug,
<Model as TimeZoneModel>::TimeZoneVariant: Debug,
impl<Model> Debug for TimeZoneInfo<Model>where
Model: Debug + TimeZoneModel,
<Model as TimeZoneModel>::LocalTime: Debug,
<Model as TimeZoneModel>::TimeZoneVariant: Debug,
Source§impl<O> GetField<()> for TimeZoneInfo<O>where
O: TimeZoneModel,
impl<O> GetField<()> for TimeZoneInfo<O>where
O: TimeZoneModel,
Source§impl<O> GetField<Option<UtcOffset>> for TimeZoneInfo<O>where
O: TimeZoneModel,
impl<O> GetField<Option<UtcOffset>> for TimeZoneInfo<O>where
O: TimeZoneModel,
Source§impl<O> GetField<TimeZone> for TimeZoneInfo<O>where
O: TimeZoneModel,
impl<O> GetField<TimeZone> for TimeZoneInfo<O>where
O: TimeZoneModel,
Source§impl<O> GetField<TimeZoneVariant> for TimeZoneInfo<O>where
O: TimeZoneModel<TimeZoneVariant = TimeZoneVariant>,
impl<O> GetField<TimeZoneVariant> for TimeZoneInfo<O>where
O: TimeZoneModel<TimeZoneVariant = TimeZoneVariant>,
Source§fn get_field(&self) -> TimeZoneVariant
fn get_field(&self) -> TimeZoneVariant
Returns the value of this trait’s field
T
.Source§impl<O> InSameCalendar for TimeZoneInfo<O>where
O: TimeZoneModel,
impl<O> InSameCalendar for TimeZoneInfo<O>where
O: TimeZoneModel,
Source§fn check_any_calendar_kind(
&self,
_: AnyCalendarKind,
) -> Result<(), MismatchedCalendarError>
fn check_any_calendar_kind( &self, _: AnyCalendarKind, ) -> Result<(), MismatchedCalendarError>
Checks whether this type is compatible with the given calendar. Read more
Source§impl<Model> PartialEq for TimeZoneInfo<Model>where
Model: PartialEq + TimeZoneModel,
<Model as TimeZoneModel>::LocalTime: PartialEq,
<Model as TimeZoneModel>::TimeZoneVariant: PartialEq,
impl<Model> PartialEq for TimeZoneInfo<Model>where
Model: PartialEq + TimeZoneModel,
<Model as TimeZoneModel>::LocalTime: PartialEq,
<Model as TimeZoneModel>::TimeZoneVariant: PartialEq,
impl<Model> Copy for TimeZoneInfo<Model>where
Model: TimeZoneModel,
impl<Model> Eq for TimeZoneInfo<Model>where
Model: Eq + TimeZoneModel,
<Model as TimeZoneModel>::LocalTime: Eq,
<Model as TimeZoneModel>::TimeZoneVariant: Eq,
impl<C, O> InFixedCalendar<C> for TimeZoneInfo<O>where
O: TimeZoneModel,
impl<Model> StructuralPartialEq for TimeZoneInfo<Model>where
Model: TimeZoneModel,
impl<O> UnstableSealed for TimeZoneInfo<O>where
O: TimeZoneModel,
Auto Trait Implementations§
impl<Model> Freeze for TimeZoneInfo<Model>where
<Model as TimeZoneModel>::LocalTime: Freeze,
<Model as TimeZoneModel>::TimeZoneVariant: Freeze,
impl<Model> RefUnwindSafe for TimeZoneInfo<Model>where
<Model as TimeZoneModel>::LocalTime: RefUnwindSafe,
<Model as TimeZoneModel>::TimeZoneVariant: RefUnwindSafe,
impl<Model> Send for TimeZoneInfo<Model>
impl<Model> Sync for TimeZoneInfo<Model>
impl<Model> Unpin for TimeZoneInfo<Model>
impl<Model> UnwindSafe for TimeZoneInfo<Model>where
<Model as TimeZoneModel>::LocalTime: UnwindSafe,
<Model as TimeZoneModel>::TimeZoneVariant: UnwindSafe,
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<T> GetField<T> for Twhere
T: Copy + UnstableSealed,
impl<T> GetField<T> for Twhere
T: Copy + UnstableSealed,
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