pub struct Rule(/* private fields */);Expand description
One transition rule of a POSIX TZ string, for example M3.5.0/2.
The value is a Copy type of 32 bits (size_of::<Rule>() == 4):
- bits 0 to 1: the
RuleKind, - bits 2 to 10: the date, 9 bits. For
Mm.w.dit is((m - 1) * 5 + (w - 1)) * 7 + d; forJnit isn - 1; fornit isn, - bits 11 to 31: the time of day, biased by
TIME_BIAS; 0 means the default 02:00:00 of a rule without/time. The bias covers the POSIX 2024 range of -167 to 167 hours with margin.
Implementations§
Source§impl Rule
impl Rule
Sourcepub const fn has_explicit_time(&self) -> bool
pub const fn has_explicit_time(&self) -> bool
Whether the rule carries an explicit /time.
Sourcepub const fn time_seconds(&self) -> i32
pub const fn time_seconds(&self) -> i32
The time of day of the transition in seconds, signed. POSIX 2024 allows
-167 to 167 hours. A rule without /time returns the default 02:00:00.
Sourcepub const fn julian_day(&self) -> u16
pub const fn julian_day(&self) -> u16
The day of the year of a Jn rule, 1 to 365.
Sourcepub const fn zero_based_day(&self) -> u16
pub const fn zero_based_day(&self) -> u16
The day of the year of an n rule, 0 to 365.
Trait Implementations§
impl Copy for Rule
impl Eq for Rule
impl StructuralPartialEq for Rule
Auto Trait Implementations§
impl Freeze for Rule
impl RefUnwindSafe for Rule
impl Send for Rule
impl Sync for Rule
impl Unpin for Rule
impl UnsafeUnpin for Rule
impl UnwindSafe for Rule
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