pub enum PatternPlurals<'data> {
MultipleVariants(PluralPattern<'data>),
SinglePattern(Pattern<'data>),
}
Expand description
Either a Pattern
single pattern or a PluralPattern
collection of
patterns when there are plural variants.
Currently, the plural forms are only based on the week number.
Variants§
MultipleVariants(PluralPattern<'data>)
A collection of pattern variants for when plurals differ.
SinglePattern(Pattern<'data>)
A single pattern.
Implementations§
source§impl<'data> PatternPlurals<'data>
impl<'data> PatternPlurals<'data>
pub fn into_owned(self) -> PatternPlurals<'static>
pub fn patterns_iter(&self) -> impl Iterator<Item = &Pattern<'data>>
pub fn for_each_mut<F>(&mut self, f: F)
pub fn expect_pattern(self, msg: &str) -> Pattern<'data>
sourcepub fn normalize(&mut self)
pub fn normalize(&mut self)
Removes redundant patterns & transforms singleton PatternPlurals::MultipleVariants into a PatternPlurals::SinglePattern.
Trait Implementations§
source§impl<'data> Clone for PatternPlurals<'data>
impl<'data> Clone for PatternPlurals<'data>
source§fn clone(&self) -> PatternPlurals<'data>
fn clone(&self) -> PatternPlurals<'data>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl<'data> Debug for PatternPlurals<'data>
impl<'data> Debug for PatternPlurals<'data>
source§impl Default for PatternPlurals<'_>
impl Default for PatternPlurals<'_>
source§fn default() -> PatternPlurals<'_>
fn default() -> PatternPlurals<'_>
Returns the “default value” for a type. Read more
source§impl From<&PatternPlurals<'_>> for Bag
impl From<&PatternPlurals<'_>> for Bag
Get the resolved components for a FixedCalendarDateTimeFormatter, via the PatternPlurals. In the case of
plurals resolve off of the required other
pattern.
source§fn from(other: &PatternPlurals<'_>) -> Bag
fn from(other: &PatternPlurals<'_>) -> Bag
Converts to this type from the input type.
source§impl<'data> From<Pattern<'data>> for PatternPlurals<'data>
impl<'data> From<Pattern<'data>> for PatternPlurals<'data>
source§fn from(pattern: Pattern<'data>) -> PatternPlurals<'data>
fn from(pattern: Pattern<'data>) -> PatternPlurals<'data>
Converts to this type from the input type.
source§impl<'data> From<PluralPattern<'data>> for PatternPlurals<'data>
impl<'data> From<PluralPattern<'data>> for PatternPlurals<'data>
source§fn from(pattern: PluralPattern<'data>) -> PatternPlurals<'data>
fn from(pattern: PluralPattern<'data>) -> PatternPlurals<'data>
Converts to this type from the input type.
source§impl<'data> PartialEq for PatternPlurals<'data>
impl<'data> PartialEq for PatternPlurals<'data>
source§impl<'a> Yokeable<'a> for PatternPlurals<'static>
impl<'a> Yokeable<'a> for PatternPlurals<'static>
source§type Output = PatternPlurals<'a>
type Output = PatternPlurals<'a>
This type MUST be
Self
with the 'static
replaced with 'a
, i.e. Self<'a>
source§fn transform_owned(self) -> <PatternPlurals<'static> as Yokeable<'a>>::Output
fn transform_owned(self) -> <PatternPlurals<'static> as Yokeable<'a>>::Output
source§unsafe fn make(
this: <PatternPlurals<'static> as Yokeable<'a>>::Output,
) -> PatternPlurals<'static>
unsafe fn make( this: <PatternPlurals<'static> as Yokeable<'a>>::Output, ) -> PatternPlurals<'static>
This method can be used to cast away
Self<'a>
’s lifetime. Read moresource§fn transform_mut<F>(&'a mut self, f: F)
fn transform_mut<F>(&'a mut self, f: F)
This method must cast
self
between &'a mut Self<'static>
and &'a mut Self<'a>
,
and pass it to f
. Read moresource§impl<'zf, 'zf_inner> ZeroFrom<'zf, PatternPlurals<'zf_inner>> for PatternPlurals<'zf>
impl<'zf, 'zf_inner> ZeroFrom<'zf, PatternPlurals<'zf_inner>> for PatternPlurals<'zf>
source§fn zero_from(this: &'zf PatternPlurals<'zf_inner>) -> PatternPlurals<'zf>
fn zero_from(this: &'zf PatternPlurals<'zf_inner>) -> PatternPlurals<'zf>
Clone the other
C
into a struct that may retain references into C
.impl<'data> StructuralPartialEq for PatternPlurals<'data>
Auto Trait Implementations§
impl<'data> Freeze for PatternPlurals<'data>
impl<'data> RefUnwindSafe for PatternPlurals<'data>
impl<'data> Send for PatternPlurals<'data>
impl<'data> Sync for PatternPlurals<'data>
impl<'data> Unpin for PatternPlurals<'data>
impl<'data> UnwindSafe for PatternPlurals<'data>
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)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