Struct icu_capi::timezone::ffi::ICU4XCustomTimeZone

source ·
pub struct ICU4XCustomTimeZone(pub CustomTimeZone);

Tuple Fields§

§0: CustomTimeZone

Implementations§

source§

impl ICU4XCustomTimeZone

source

pub fn create_from_string( s: &DiplomatStr, ) -> Result<Box<ICU4XCustomTimeZone>, ICU4XError>

Creates a time zone from an offset string.

source

pub fn create_empty() -> Box<ICU4XCustomTimeZone>

Creates a time zone with no information.

source

pub fn create_utc() -> Box<ICU4XCustomTimeZone>

Creates a time zone for UTC.

source

pub fn try_set_gmt_offset_seconds( &mut self, offset_seconds: i32, ) -> Result<(), ICU4XError>

Sets the gmt_offset field from offset seconds.

Errors if the offset seconds are out of range.

source

pub fn clear_gmt_offset(&mut self)

Clears the gmt_offset field.

source

pub fn gmt_offset_seconds(&self) -> Result<i32, ICU4XError>

Returns the value of the gmt_offset field as offset seconds.

Errors if the gmt_offset field is empty.

source

pub fn is_gmt_offset_positive(&self) -> Result<bool, ICU4XError>

Returns whether the gmt_offset field is positive.

Errors if the gmt_offset field is empty.

source

pub fn is_gmt_offset_zero(&self) -> Result<bool, ICU4XError>

Returns whether the gmt_offset field is zero.

Errors if the gmt_offset field is empty (which is not the same as zero).

source

pub fn gmt_offset_has_minutes(&self) -> Result<bool, ICU4XError>

Returns whether the gmt_offset field has nonzero minutes.

Errors if the gmt_offset field is empty.

source

pub fn gmt_offset_has_seconds(&self) -> Result<bool, ICU4XError>

Returns whether the gmt_offset field has nonzero seconds.

Errors if the gmt_offset field is empty.

source

pub fn try_set_time_zone_id( &mut self, id: &DiplomatStr, ) -> Result<(), ICU4XError>

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 try_set_iana_time_zone_id( &mut self, mapper: &ICU4XIanaToBcp47Mapper, id: &DiplomatStr, ) -> Result<(), ICU4XError>

Sets the time_zone_id field from an IANA string by looking up the corresponding BCP-47 string.

Errors if the string is not a valid BCP-47 time zone ID.

source

pub fn try_set_iana_time_zone_id_2( &mut self, mapper: &ICU4XTimeZoneIdMapper, id: &DiplomatStr, ) -> Result<(), ICU4XError>

Sets the time_zone_id field from an IANA string by looking up the corresponding BCP-47 string.

Errors if the string is not a valid BCP-47 time zone ID.

source

pub fn clear_time_zone_id(&mut self)

Clears the time_zone_id field.

source

pub fn time_zone_id( &self, write: &mut DiplomatWriteable, ) -> Result<(), ICU4XError>

Writes the value of the time_zone_id field as a string.

Errors if the time_zone_id field is empty.

source

pub fn try_set_metazone_id( &mut self, id: &DiplomatStr, ) -> Result<(), ICU4XError>

Sets the metazone_id field from a string.

Errors if the string is not a valid BCP-47 metazone ID.

source

pub fn clear_metazone_id(&mut self)

Clears the metazone_id field.

source

pub fn metazone_id( &self, write: &mut DiplomatWriteable, ) -> Result<(), ICU4XError>

Writes the value of the metazone_id field as a string.

Errors if the metazone_id field is empty.

source

pub fn try_set_zone_variant( &mut self, id: &DiplomatStr, ) -> Result<(), ICU4XError>

Sets the zone_variant field from a string.

Errors if the string is not a valid zone variant.

source

pub fn clear_zone_variant(&mut self)

Clears the zone_variant field.

source

pub fn zone_variant( &self, write: &mut DiplomatWriteable, ) -> Result<(), ICU4XError>

Writes the value of the zone_variant field as a string.

Errors if the zone_variant field is empty.

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) -> Result<bool, ICU4XError>

Returns whether the zone_variant field is standard time.

Errors if the zone_variant field is empty.

source

pub fn is_daylight_time(&self) -> Result<bool, ICU4XError>

Returns whether the zone_variant field is daylight time.

Errors if the zone_variant field is empty.

source

pub fn maybe_calculate_metazone( &mut self, metazone_calculator: &ICU4XMetazoneCalculator, local_datetime: &ICU4XIsoDateTime, )

Sets the metazone based on the time zone and the local timestamp.

Trait Implementations§

source§

impl From<CustomTimeZone> for ICU4XCustomTimeZone

source§

fn from(other: CustomTimeZone) -> Self

Converts to this type from the input type.
source§

impl From<ICU4XCustomTimeZone> for CustomTimeZone

source§

fn from(other: ICU4XCustomTimeZone) -> 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> Filterable for T

source§

fn filterable( self, filter_name: &'static str, ) -> RequestFilterDataProvider<T, fn(_: DataRequest<'_>) -> bool>

Creates a filterable data provider with the given name for debugging. 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>,

§

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>,

§

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