Struct icu_capi::timezone::ffi::ICU4XCustomTimeZone
source · pub struct ICU4XCustomTimeZone(pub CustomTimeZone);
Tuple Fields§
§0: CustomTimeZone
Implementations§
source§impl ICU4XCustomTimeZone
impl ICU4XCustomTimeZone
sourcepub fn create_from_string(
s: &DiplomatStr,
) -> Result<Box<ICU4XCustomTimeZone>, ICU4XError>
pub fn create_from_string( s: &DiplomatStr, ) -> Result<Box<ICU4XCustomTimeZone>, ICU4XError>
Creates a time zone from an offset string.
sourcepub fn create_empty() -> Box<ICU4XCustomTimeZone>
pub fn create_empty() -> Box<ICU4XCustomTimeZone>
Creates a time zone with no information.
sourcepub fn create_utc() -> Box<ICU4XCustomTimeZone>
pub fn create_utc() -> Box<ICU4XCustomTimeZone>
Creates a time zone for UTC.
sourcepub fn try_set_gmt_offset_seconds(
&mut self,
offset_seconds: i32,
) -> Result<(), ICU4XError>
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.
sourcepub fn clear_gmt_offset(&mut self)
pub fn clear_gmt_offset(&mut self)
Clears the gmt_offset
field.
sourcepub fn gmt_offset_seconds(&self) -> Result<i32, ICU4XError>
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.
sourcepub fn is_gmt_offset_positive(&self) -> Result<bool, ICU4XError>
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.
sourcepub fn is_gmt_offset_zero(&self) -> Result<bool, ICU4XError>
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).
sourcepub fn gmt_offset_has_minutes(&self) -> Result<bool, ICU4XError>
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.
sourcepub fn gmt_offset_has_seconds(&self) -> Result<bool, ICU4XError>
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.
sourcepub fn try_set_time_zone_id(
&mut self,
id: &DiplomatStr,
) -> Result<(), ICU4XError>
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.
sourcepub fn try_set_iana_time_zone_id(
&mut self,
mapper: &ICU4XIanaToBcp47Mapper,
id: &DiplomatStr,
) -> Result<(), ICU4XError>
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.
sourcepub fn try_set_iana_time_zone_id_2(
&mut self,
mapper: &ICU4XTimeZoneIdMapper,
id: &DiplomatStr,
) -> Result<(), ICU4XError>
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.
sourcepub fn clear_time_zone_id(&mut self)
pub fn clear_time_zone_id(&mut self)
Clears the time_zone_id
field.
sourcepub fn time_zone_id(
&self,
write: &mut DiplomatWriteable,
) -> Result<(), ICU4XError>
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.
sourcepub fn try_set_metazone_id(
&mut self,
id: &DiplomatStr,
) -> Result<(), ICU4XError>
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.
sourcepub fn clear_metazone_id(&mut self)
pub fn clear_metazone_id(&mut self)
Clears the metazone_id
field.
sourcepub fn metazone_id(
&self,
write: &mut DiplomatWriteable,
) -> Result<(), ICU4XError>
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.
sourcepub fn try_set_zone_variant(
&mut self,
id: &DiplomatStr,
) -> Result<(), ICU4XError>
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.
sourcepub fn clear_zone_variant(&mut self)
pub fn clear_zone_variant(&mut self)
Clears the zone_variant
field.
sourcepub fn zone_variant(
&self,
write: &mut DiplomatWriteable,
) -> Result<(), ICU4XError>
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.
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) -> Result<bool, ICU4XError>
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.
sourcepub fn is_daylight_time(&self) -> Result<bool, ICU4XError>
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.
sourcepub fn maybe_calculate_metazone(
&mut self,
metazone_calculator: &ICU4XMetazoneCalculator,
local_datetime: &ICU4XIsoDateTime,
)
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
impl From<CustomTimeZone> for ICU4XCustomTimeZone
source§fn from(other: CustomTimeZone) -> Self
fn from(other: CustomTimeZone) -> Self
source§impl From<ICU4XCustomTimeZone> for CustomTimeZone
impl From<ICU4XCustomTimeZone> for CustomTimeZone
source§fn from(other: ICU4XCustomTimeZone) -> Self
fn from(other: ICU4XCustomTimeZone) -> Self
Auto Trait Implementations§
impl Freeze for ICU4XCustomTimeZone
impl RefUnwindSafe for ICU4XCustomTimeZone
impl Send for ICU4XCustomTimeZone
impl Sync for ICU4XCustomTimeZone
impl Unpin for ICU4XCustomTimeZone
impl UnwindSafe for ICU4XCustomTimeZone
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> Filterable for T
impl<T> Filterable for T
source§fn filterable(
self,
filter_name: &'static str,
) -> RequestFilterDataProvider<T, fn(_: DataRequest<'_>) -> bool>
fn filterable( self, filter_name: &'static str, ) -> RequestFilterDataProvider<T, fn(_: DataRequest<'_>) -> bool>
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