Struct icu_capi::timezone::ffi::TimeZoneInfo
source · pub struct TimeZoneInfo { /* private fields */ }
Implementations§
source§impl TimeZoneInfo
impl TimeZoneInfo
sourcepub fn unknown() -> Box<TimeZoneInfo>
pub fn unknown() -> Box<TimeZoneInfo>
Creates a time zone with no information.
sourcepub fn utc() -> Box<TimeZoneInfo>
pub fn utc() -> Box<TimeZoneInfo>
Creates a time zone for UTC (Coordinated Universal Time).
sourcepub fn from_parts(
bcp47_id: &DiplomatStr,
offset_seconds: i32,
dst: bool,
) -> Box<TimeZoneInfo>
pub fn from_parts( bcp47_id: &DiplomatStr, offset_seconds: i32, dst: bool, ) -> Box<TimeZoneInfo>
Creates a time zone.
sourcepub fn try_set_offset_seconds(
&mut self,
offset_seconds: i32,
) -> Result<(), TimeZoneInvalidOffsetError>
pub fn try_set_offset_seconds( &mut self, offset_seconds: i32, ) -> Result<(), TimeZoneInvalidOffsetError>
Sets the offset
field from offset seconds.
Errors if the offset seconds are out of range.
sourcepub fn set_offset_eighths_of_hour(&mut self, offset_eighths_of_hour: i8)
pub fn set_offset_eighths_of_hour(&mut self, offset_eighths_of_hour: i8)
Sets the offset
field from offset as eighths of an hour.
sourcepub fn try_set_offset_str(
&mut self,
offset: &DiplomatStr,
) -> Result<(), TimeZoneInvalidOffsetError>
pub fn try_set_offset_str( &mut self, offset: &DiplomatStr, ) -> Result<(), TimeZoneInvalidOffsetError>
Sets the offset
field from a string.
sourcepub fn offset_eighths_of_hour(&self) -> Option<i8>
pub fn offset_eighths_of_hour(&self) -> Option<i8>
Gets the offset
field from offset as eighths of an hour.
sourcepub fn clear_offset(&mut self)
pub fn clear_offset(&mut self)
Clears the offset
field.
sourcepub fn offset_seconds(&self) -> Option<i32>
pub fn offset_seconds(&self) -> Option<i32>
Returns the value of the offset
field as offset seconds.
Returns null if the offset
field is empty.
sourcepub fn is_offset_non_negative(&self) -> Option<bool>
pub fn is_offset_non_negative(&self) -> Option<bool>
Returns whether the offset
field is positive.
Returns null if the offset
field is empty.
sourcepub fn is_offset_zero(&self) -> Option<bool>
pub fn is_offset_zero(&self) -> Option<bool>
Returns whether the offset
field is zero.
Returns null if the offset
field is empty (which is not the same as zero).
sourcepub fn offset_hours_part(&self) -> Option<i32>
pub fn offset_hours_part(&self) -> Option<i32>
Returns the hours part of the the offset
field.
Returns null if the offset
field is empty.
sourcepub fn offset_minutes_part(&self) -> Option<u32>
pub fn offset_minutes_part(&self) -> Option<u32>
Returns the minutes part of the the offset
field.
Returns null if the offset
field is empty.
sourcepub fn offset_seconds_part(&self) -> Option<u32>
pub fn offset_seconds_part(&self) -> Option<u32>
Returns the seconds part of the the offset
field.
Returns null if the offset
field is empty.
sourcepub fn set_time_zone_id(&mut self, id: &DiplomatStr)
pub fn set_time_zone_id(&mut self, id: &DiplomatStr)
Sets the time_zone_id
field from a BCP-47 string.
Errors if the string is not a valid BCP-47 time zone ID.
sourcepub fn set_iana_time_zone_id(
&mut self,
mapper: &TimeZoneIdMapper,
id: &DiplomatStr,
)
pub fn set_iana_time_zone_id( &mut self, mapper: &TimeZoneIdMapper, id: &DiplomatStr, )
Sets the time_zone_id
field from an IANA string by looking up
the corresponding BCP-47 string.
sourcepub fn time_zone_id(&self, write: &mut DiplomatWrite)
pub fn time_zone_id(&self, write: &mut DiplomatWrite)
Writes the value of the time_zone_id
field as a string.
Returns null if the time_zone_id
field is empty.
sourcepub fn clear_zone_variant(&mut self)
pub fn clear_zone_variant(&mut self)
Clears the zone_variant
field.
sourcepub fn set_standard_time(&mut self)
pub fn set_standard_time(&mut self)
Sets the zone_variant
field to standard time, which may or may
not correspond to a display name with Standard in its name.
sourcepub fn set_daylight_time(&mut self)
pub fn set_daylight_time(&mut self)
Sets the zone_variant
field to “daylight” time, which may or may
not correspond to a display name with “Daylight” in its name.
sourcepub fn is_standard_time(&self) -> Option<bool>
pub fn is_standard_time(&self) -> Option<bool>
Returns whether the zone_variant
field is standard time.
Returns null if the zone_variant
field is empty.
sourcepub fn is_daylight_time(&self) -> Option<bool>
pub fn is_daylight_time(&self) -> Option<bool>
Returns whether the zone_variant
field is daylight time.
Returns null if the zone_variant
field is empty.
sourcepub fn set_local_time(&mut self, datetime: &IsoDateTime)
pub fn set_local_time(&mut self, datetime: &IsoDateTime)
Sets the local_time
field.
sourcepub fn clear_local_time(&mut self)
pub fn clear_local_time(&mut self)
Clears the local_time
field.
sourcepub fn get_local_time(&self) -> Option<Box<IsoDateTime>>
pub fn get_local_time(&self) -> Option<Box<IsoDateTime>>
Returns a copy of the local_time
field.
Trait Implementations§
source§impl From<TimeZoneInfo<Base>> for TimeZoneInfo
impl From<TimeZoneInfo<Base>> for TimeZoneInfo
source§fn from(other: TimeZoneInfo<Base>) -> Self
fn from(other: TimeZoneInfo<Base>) -> Self
Auto Trait Implementations§
impl Freeze for TimeZoneInfo
impl RefUnwindSafe for TimeZoneInfo
impl Send for TimeZoneInfo
impl Sync for TimeZoneInfo
impl Unpin for TimeZoneInfo
impl UnwindSafe for TimeZoneInfo
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
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>
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>
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