Enum icu::calendar::AnyCalendarKind
source · [−]#[non_exhaustive]
pub enum AnyCalendarKind {
Gregorian,
Buddhist,
Japanese,
JapaneseExtended,
Ethiopian,
EthiopianAmeteAlem,
Indian,
Coptic,
Iso,
}
Expand description
Convenient type for selecting the kind of AnyCalendar to construct
Variants (Non-exhaustive)
This enum is marked as non-exhaustive
Gregorian
The kind of a Gregorian
calendar
Buddhist
The kind of a Buddhist
calendar
Japanese
The kind of a Japanese
calendar
JapaneseExtended
The kind of a JapaneseExtended
calendar
Ethiopian
The kind of an Ethiopian
calendar, with Amete Mihret era
EthiopianAmeteAlem
The kind of an Ethiopian
calendar, with Amete Alem era
Indian
The kind of a Indian
calendar
Coptic
The kind of a Coptic
calendar
Iso
The kind of an Iso
calendar
Implementations
sourceimpl AnyCalendarKind
impl AnyCalendarKind
sourcepub fn get_for_bcp47_string(x: &str) -> Option<AnyCalendarKind>
pub fn get_for_bcp47_string(x: &str) -> Option<AnyCalendarKind>
Construct from a BCP-47 string
Returns None if the calendar is unknown. If you prefer an error, use
CalendarError::unknown_any_calendar_kind
.
sourcepub fn get_for_bcp47_bytes(x: &[u8]) -> Option<AnyCalendarKind>
pub fn get_for_bcp47_bytes(x: &[u8]) -> Option<AnyCalendarKind>
Construct from a BCP-47 byte string
Returns None if the calendar is unknown. If you prefer an error, use
CalendarError::unknown_any_calendar_kind
.
sourcepub fn get_for_bcp47_value(x: &Value) -> Option<AnyCalendarKind>
pub fn get_for_bcp47_value(x: &Value) -> Option<AnyCalendarKind>
Construct from a BCP-47 Value
Returns None if the calendar is unknown. If you prefer an error, use
CalendarError::unknown_any_calendar_kind
.
sourcepub fn as_bcp47_string(self) -> &'static str
pub fn as_bcp47_string(self) -> &'static str
Convert to a BCP-47 string
sourcepub fn as_bcp47_value(self) -> Value
pub fn as_bcp47_value(self) -> Value
Convert to a BCP-47 Value
sourcepub fn get_for_locale(l: &Locale) -> Option<AnyCalendarKind>
pub fn get_for_locale(l: &Locale) -> Option<AnyCalendarKind>
Extract the calendar component from a Locale
Returns None if the calendar is not specified or unknown. If you prefer an error, use
CalendarError::unknown_any_calendar_kind
.
Trait Implementations
sourceimpl Clone for AnyCalendarKind
impl Clone for AnyCalendarKind
sourcefn clone(&self) -> AnyCalendarKind
fn clone(&self) -> AnyCalendarKind
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for AnyCalendarKind
impl Debug for AnyCalendarKind
sourceimpl Display for AnyCalendarKind
impl Display for AnyCalendarKind
sourceimpl Hash for AnyCalendarKind
impl Hash for AnyCalendarKind
sourceimpl Ord for AnyCalendarKind
impl Ord for AnyCalendarKind
sourceimpl PartialEq<AnyCalendarKind> for AnyCalendarKind
impl PartialEq<AnyCalendarKind> for AnyCalendarKind
sourceimpl PartialOrd<AnyCalendarKind> for AnyCalendarKind
impl PartialOrd<AnyCalendarKind> for AnyCalendarKind
sourcefn partial_cmp(&self, other: &AnyCalendarKind) -> Option<Ordering>
fn partial_cmp(&self, other: &AnyCalendarKind) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
impl Copy for AnyCalendarKind
impl Eq for AnyCalendarKind
impl StructuralEq for AnyCalendarKind
impl StructuralPartialEq for AnyCalendarKind
Auto Trait Implementations
impl RefUnwindSafe for AnyCalendarKind
impl Send for AnyCalendarKind
impl Sync for AnyCalendarKind
impl Unpin for AnyCalendarKind
impl UnwindSafe for AnyCalendarKind
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Separable for T where
T: Display,
impl<T> Separable for T where
T: Display,
sourcefn separate_by_policy(&self, policy: SeparatorPolicy<'_>) -> String
fn separate_by_policy(&self, policy: SeparatorPolicy<'_>) -> String
Adds separators according to the given SeparatorPolicy
. Read more
sourcefn separate_with_commas(&self) -> String
fn separate_with_commas(&self) -> String
Inserts a comma every three digits from the right. Read more
sourcefn separate_with_spaces(&self) -> String
fn separate_with_spaces(&self) -> String
Inserts a space every three digits from the right. Read more
sourcefn separate_with_dots(&self) -> String
fn separate_with_dots(&self) -> String
Inserts a period every three digits from the right. Read more
sourcefn separate_with_underscores(&self) -> String
fn separate_with_underscores(&self) -> String
Inserts an underscore every three digits from the right. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more