pub enum NeoTimeZoneSpecificShortMarker {}
Expand description
“CDT” ⇒ specific time zone with a shorter length, or raw offset if unavailable
§Examples
In NeoFormatter
:
use icu::timezone::CustomTimeZone;
use icu::datetime::neo::NeoFormatter;
use icu::datetime::neo_marker::NeoTimeZoneSpecificShortMarker;
use icu::datetime::neo_skeleton::NeoSkeletonLength;
use icu::locale::locale;
use tinystr::tinystr;
use writeable::assert_try_writeable_eq;
let fmt = NeoFormatter::<NeoTimeZoneSpecificShortMarker>::try_new(
&locale!("en").into(),
Default :: default(),
)
.unwrap();
// Time zone for America/Chicago in the summer
let zone = CustomTimeZone::from_parts(
-40, // offset eighths of hour
tinystr!(8, "uschi"), // time zone ID
tinystr!(4, "amce"), // metazone ID
tinystr!(2, "dt"), // zone variant: daylight time
);
assert_try_writeable_eq!(
fmt.convert_and_format(&zone),
"CDT"
);
use icu::calendar::{Date, Time};
use icu::timezone::{CustomTimeZone, CustomZonedDateTime};
use icu::calendar::Gregorian;
use icu::datetime::neo::TypedNeoFormatter;
use icu::datetime::neo_marker::NeoTimeZoneSpecificShortMarker;
use icu::datetime::neo_skeleton::NeoSkeletonLength;
use icu::locale::locale;
use tinystr::tinystr;
use writeable::assert_try_writeable_eq;
let fmt = TypedNeoFormatter::<Gregorian, NeoTimeZoneSpecificShortMarker>::try_new(
&locale!("en").into(),
Default :: default(),
)
.unwrap();
// Time zone for America/Chicago in the summer
let zone = CustomTimeZone::from_parts(
-40, // offset eighths of hour
tinystr!(8, "uschi"), // time zone ID
tinystr!(4, "amce"), // metazone ID
tinystr!(2, "dt"), // zone variant: daylight time
);
assert_try_writeable_eq!(
fmt.format(&zone),
"CDT"
);
When a display name is unavailable, falls back to the offset format:
use icu::calendar::{Date, Time};
use icu::timezone::{CustomTimeZone, CustomZonedDateTime};
use icu::calendar::Gregorian;
use icu::datetime::neo::TypedNeoFormatter;
use icu::datetime::neo_marker::NeoTimeZoneSpecificShortMarker;
use icu::datetime::neo_skeleton::NeoSkeletonLength;
use icu::locale::locale;
use tinystr::tinystr;
use writeable::assert_try_writeable_eq;
let fmt = TypedNeoFormatter::<Gregorian, NeoTimeZoneSpecificShortMarker>::try_new(
&locale!("en").into(),
Default::default(),
)
.unwrap();
// Time zone for America/Sao_Paulo year-round
let zone = CustomTimeZone::from_parts(
-24, // offset eighths of hour
tinystr!(8, "brsao"), // time zone ID
tinystr!(4, "bras"), // metazone ID
tinystr!(2, "st"), // zone variant: standard time
);
assert_try_writeable_eq!(
fmt.format(&zone),
"GMT-03:00"
);
Trait Implementations§
source§impl DateTimeMarkers for NeoTimeZoneSpecificShortMarker
impl DateTimeMarkers for NeoTimeZoneSpecificShortMarker
§type D = NeoNeverMarker
type D = NeoNeverMarker
Associated types for date formatting. Read more
§type T = NeoNeverMarker
type T = NeoNeverMarker
Associated types for time formatting. Read more
§type Z = NeoTimeZoneSpecificShortMarker
type Z = NeoTimeZoneSpecificShortMarker
Associated types for time zone formatting. Read more
§type LengthOption = NeverField
type LengthOption = NeverField
Type of the length option in the constructor.
§type AlignmentOption = NeverField
type AlignmentOption = NeverField
Type of the alignment option in the constructor.
§type EraDisplayOption = NeverField
type EraDisplayOption = NeverField
Type of the era display option in the constructor.
§type FractionalSecondDigitsOption = NeverField
type FractionalSecondDigitsOption = NeverField
Type of the fractional seconds display option in the constructor.
§type GluePatternV1Marker = NeverMarker<GluePatternV1<'static>>
type GluePatternV1Marker = NeverMarker<GluePatternV1<'static>>
Marker for loading the date/time glue pattern.
source§impl HasConstComponents for NeoTimeZoneSpecificShortMarker
impl HasConstComponents for NeoTimeZoneSpecificShortMarker
source§const COMPONENTS: NeoComponents = _
const COMPONENTS: NeoComponents = _
The associated components.
source§impl HasConstZoneComponent for NeoTimeZoneSpecificShortMarker
impl HasConstZoneComponent for NeoTimeZoneSpecificShortMarker
source§const COMPONENT: NeoTimeZoneSkeleton = _
const COMPONENT: NeoTimeZoneSkeleton = _
The associated component.
source§impl ZoneMarkers for NeoTimeZoneSpecificShortMarker
impl ZoneMarkers for NeoTimeZoneSpecificShortMarker
§type TimeZoneOffsetInput = Option<UtcOffset>
type TimeZoneOffsetInput = Option<UtcOffset>
Marker for resolving the time zone offset input field.
§type TimeZoneIdInput = Option<TimeZoneBcp47Id>
type TimeZoneIdInput = Option<TimeZoneBcp47Id>
Marker for resolving the time zone id input field.
§type TimeZoneMetazoneInput = Option<MetazoneId>
type TimeZoneMetazoneInput = Option<MetazoneId>
Marker for resolving the time zone metazone input field.
§type TimeZoneVariantInput = Option<ZoneVariant>
type TimeZoneVariantInput = Option<ZoneVariant>
Marker for resolving the time zone variant input field.
§type EssentialsV1Marker = TimeZoneFormatsV1Marker
type EssentialsV1Marker = TimeZoneFormatsV1Marker
Marker for loading core time zone data.
§type ExemplarCitiesV1Marker = NeverMarker<ExemplarCitiesV1<'static>>
type ExemplarCitiesV1Marker = NeverMarker<ExemplarCitiesV1<'static>>
Marker for loading exemplar city names for time zone formatting
§type GenericLongV1Marker = NeverMarker<MetazoneGenericNamesLongV1<'static>>
type GenericLongV1Marker = NeverMarker<MetazoneGenericNamesLongV1<'static>>
Marker for loading generic short time zone names.
§type GenericShortV1Marker = NeverMarker<MetazoneGenericNamesShortV1<'static>>
type GenericShortV1Marker = NeverMarker<MetazoneGenericNamesShortV1<'static>>
Marker for loading generic short time zone names.
§type SpecificLongV1Marker = NeverMarker<MetazoneSpecificNamesLongV1<'static>>
type SpecificLongV1Marker = NeverMarker<MetazoneSpecificNamesLongV1<'static>>
Marker for loading generic short time zone names.
§type SpecificShortV1Marker = MetazoneSpecificNamesShortV1Marker
type SpecificShortV1Marker = MetazoneSpecificNamesShortV1Marker
Marker for loading generic short time zone names.
Auto Trait Implementations§
impl Freeze for NeoTimeZoneSpecificShortMarker
impl RefUnwindSafe for NeoTimeZoneSpecificShortMarker
impl Send for NeoTimeZoneSpecificShortMarker
impl Sync for NeoTimeZoneSpecificShortMarker
impl Unpin for NeoTimeZoneSpecificShortMarker
impl UnwindSafe for NeoTimeZoneSpecificShortMarker
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
Mutably borrows from an owned value. Read more
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>
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 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>
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