[−][src]Struct sunrise_libtimezone::TimeZoneRule
Represent the rules defining a TimeZone.
Fields
timecnt: i32
The count of time transitions.
typecnt: i32
The count of time type infos.
charcnt: i32
The count of chars.
goback: bool
Used to control the rule that should apply when a specified time is out of any rules in the past.
goahead: bool
Used to control the rule that should apply when a specified time is out of any rules in the future.
ats: [Time; 1000]
Time transition timepoints.
types: [u8; 1000]
Time transition types.
ttis: [TimeTypeInfo; 128]
Time type infos.
chars: [u8; 512]
The chars.
default_type: i32
The index of the default type (usually zero).
reserved: [u8; 4804]
Reserved / Unused space.
Implementations
impl TimeZoneRule
[src][−]
pub fn from_bytes(buffer: &[u8]) -> &Self
[src][−]
Load the given timezones rules from a given slice contains an actual TimeZoneRule.
Panic:
This function panic if the given buffer is either too short or not aligned
pub fn from_mut_bytes(buffer: &mut [u8]) -> &mut Self
[src][−]
Load the given timezones rules from a given slice contains an actual TimeZoneRule.
Panic:
This function panic if the given buffer is either too short or not aligned
pub fn load_rules(
&mut self,
input: &[u8],
temp_rules: &mut TimeZoneRule
) -> TimeZoneResult<()>
[src][−]
&mut self,
input: &[u8],
temp_rules: &mut TimeZoneRule
) -> TimeZoneResult<()>
Load the given timezones rules from a given slice containing TzIf2 data and a temporary TimeZoneRule buffer.
Note:
temp_rules
is used to store parsed data from the TZ String Extensions. this shouldn't be used as a standard TimeZoneRule!
pub fn to_calendar_time(&self, time: PosixTime) -> TimeZoneResult<CalendarTime>
[src][−]
Convert a PosixTime to a CalendarTime using the current timezone.
pub fn to_posix_time(
&self,
calendar_time: &CalendarTimeInfo
) -> TimeZoneResult<PosixTime>
[src][−]
&self,
calendar_time: &CalendarTimeInfo
) -> TimeZoneResult<PosixTime>
Convert a CalendarTime to a PosixTime using the current timezone.
Trait Implementations
impl Clone for TimeZoneRule
[src][+]
impl Copy for TimeZoneRule
[src]
impl Default for TimeZoneRule
[src][+]
impl Plain for TimeZoneRule
[src][+]
Auto Trait Implementations
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src][+]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src][+]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src][+]
T: ?Sized,
impl<T> From<T> for T
[src][+]
impl<T, U> Into<U> for T where
U: From<T>,
[src][+]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src][+]
U: Into<T>,
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src][+]
U: TryFrom<T>,