Skip to main content

Transition

Struct Transition 

Source
pub struct Transition { /* private fields */ }
Expand description

Transition of a TZif file

Implementations§

Source§

impl Transition

Source

pub const fn new(unix_leap_time: i64, local_time_type_index: usize) -> Self

Construct a TZif file transition

Examples found in repository?
examples/statics.rs (line 17)
15    const TIME_ZONE_REF: TimeZoneRef<'static> = unwrap!(TimeZoneRef::new(
16        &[
17            Transition::new(-2334101314, 1),
18            Transition::new(-1157283000, 2),
19            Transition::new(-1155436200, 1),
20            Transition::new(-880198200, 3),
21            Transition::new(-769395600, 4),
22            Transition::new(-765376200, 1),
23            Transition::new(-712150200, 5),
24        ],
25        const {
26            &[
27                unwrap!(LocalTimeType::new(-37886, false, Some(b"LMT"))),
28                unwrap!(LocalTimeType::new(-37800, false, Some(b"HST"))),
29                unwrap!(LocalTimeType::new(-34200, true, Some(b"HDT"))),
30                unwrap!(LocalTimeType::new(-34200, true, Some(b"HWT"))),
31                unwrap!(LocalTimeType::new(-34200, true, Some(b"HPT"))),
32                unwrap!(LocalTimeType::new(-36000, false, Some(b"HST"))),
33            ]
34        },
35        &[
36            LeapSecond::new(78796800, 1),
37            LeapSecond::new(94694401, 2),
38            LeapSecond::new(126230402, 3),
39            LeapSecond::new(157766403, 4),
40            LeapSecond::new(189302404, 5),
41            LeapSecond::new(220924805, 6),
42        ],
43        const {
44            &Some(TransitionRule::Alternate(unwrap!(AlternateTime::new(
45                unwrap!(LocalTimeType::new(-36000, false, Some(b"HST"))),
46                unwrap!(LocalTimeType::new(-34200, true, Some(b"HPT"))),
47                RuleDay::MonthWeekDay(unwrap!(MonthWeekDay::new(10, 5, 0))),
48                93600,
49                RuleDay::MonthWeekDay(unwrap!(MonthWeekDay::new(3, 4, 4))),
50                7200,
51            ))))
52        },
53    ));
Source

pub const fn unix_leap_time(&self) -> i64

Returns Unix leap time

Source

pub const fn local_time_type_index(&self) -> usize

Returns local time type index

Trait Implementations§

Source§

impl Clone for Transition

Source§

fn clone(&self) -> Transition

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for Transition

Source§

impl Debug for Transition

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for Transition

Source§

impl PartialEq for Transition

Source§

fn eq(&self, other: &Transition) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for Transition

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.