pub struct ZoneSpec {
pub name: &'static str,
pub std_offset: i32,
pub dst: Option<(i32, DstRule, DstRule)>,
}Expand description
A named time zone: its standard UTC offset, and an optional DST schedule (dst_offset, spring rule, fall rule). A zone with dst = None is a fixed offset (UTC, IST, JST). DST transitions
are generated per year from the rules, so a ZoneSpec is tiny — no transition table.
Fields§
§name: &'static str§std_offset: i32§dst: Option<(i32, DstRule, DstRule)>Implementations§
Source§impl ZoneSpec
impl ZoneSpec
Sourcepub fn transitions(&self, start_year: i64, end_year: i64) -> Vec<ZoneTransition>
pub fn transitions(&self, start_year: i64, end_year: i64) -> Vec<ZoneTransition>
The zone’s UTC transitions for every year in start_year..=end_year, sorted ascending
(empty for a fixed-offset zone).
Sourcepub fn to_local(&self, instant_ns: i64) -> CivilDateTime
pub fn to_local(&self, instant_ns: i64) -> CivilDateTime
The local civil date-time of a UTC instant in this zone (DST resolved from the rules).
Trait Implementations§
impl Copy for ZoneSpec
impl Eq for ZoneSpec
impl StructuralPartialEq for ZoneSpec
Auto Trait Implementations§
impl Freeze for ZoneSpec
impl RefUnwindSafe for ZoneSpec
impl Send for ZoneSpec
impl Sync for ZoneSpec
impl Unpin for ZoneSpec
impl UnsafeUnpin for ZoneSpec
impl UnwindSafe for ZoneSpec
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