Struct icu_capi::timezone::ffi::TimeZoneInfo

source ·
pub struct TimeZoneInfo { /* private fields */ }

Implementations§

source§

impl TimeZoneInfo

source

pub fn unknown() -> Box<TimeZoneInfo>

Creates a time zone with no information.

source

pub fn utc() -> Box<TimeZoneInfo>

Creates a time zone for UTC (Coordinated Universal Time).

source

pub fn from_parts( bcp47_id: &DiplomatStr, offset_seconds: i32, dst: bool, ) -> Box<TimeZoneInfo>

Creates a time zone.

source

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.

source

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.

source

pub fn try_set_offset_str( &mut self, offset: &DiplomatStr, ) -> Result<(), TimeZoneInvalidOffsetError>

Sets the offset field from a string.

source

pub fn offset_eighths_of_hour(&self) -> Option<i8>

Gets the offset field from offset as eighths of an hour.

source

pub fn clear_offset(&mut self)

Clears the offset field.

source

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.

source

pub fn is_offset_non_negative(&self) -> Option<bool>

Returns whether the offset field is positive.

Returns null if the offset field is empty.

source

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).

source

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.

source

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.

source

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.

source

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.

source

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.

source

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.

source

pub fn clear_zone_variant(&mut self)

Clears the zone_variant field.

source

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.

source

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.

source

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.

source

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.

source

pub fn set_local_time(&mut self, datetime: &IsoDateTime)

Sets the local_time field.

source

pub fn clear_local_time(&mut self)

Clears the local_time field.

source

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

source§

fn from(other: TimeZoneInfo<Base>) -> Self

Converts to this type from the input type.

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> 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> IntoEither for T

source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
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.
source§

impl<T> ErasedDestructor for T
where T: 'static,

source§

impl<T> MaybeSendSync for T
where T: Send + Sync,