Enum icu_datetime::fields::length::FieldLength
source · pub enum FieldLength {
One,
TwoDigit,
Abbreviated,
Wide,
Narrow,
Six,
Fixed(u8),
NumericOverride(FieldNumericOverrides),
}
Expand description
An enum representing the length of a field within a date or time formatting pattern string,
in which the pattern field is represented as a letter occurring 1 or more times in a row, ex:
MMM
, dd
, y
. See the
LDML documentation in UTS 35
for more details.
Variants§
One
Typical style is 1-2 digits. For numeric-only fields.
TwoDigit
Typical style is 2 digits. For numeric-only fields.
Abbreviated
Abbreviated (spellout) format.
Wide
Wide / Long / Full (spellout) format.
Narrow
Narrow / Long / Full (spellout) format.
Six
Meaning is field-dependent, for patterns that are 6 characters long. Ex: a Weekday
pattern like
EEEEEE
means “Short”, but jjjjjj
or CCCCCC
for Hour
may mean
“Numeric hour (2 digits, zero pad if needed), narrow dayPeriod if used”. See the
LDML documentation in UTS 35
for more details.
Fixed(u8)
A fixed size format for numeric-only fields that is at most 127 digits.
NumericOverride(FieldNumericOverrides)
FieldLength::One (numeric), but overridden with a different numbering system
Implementations§
Trait Implementations§
source§impl AsULE for FieldLength
impl AsULE for FieldLength
source§type ULE = FieldLengthULE
type ULE = FieldLengthULE
Self
. Read moresource§fn to_unaligned(self) -> Self::ULE
fn to_unaligned(self) -> Self::ULE
source§fn from_unaligned(unaligned: Self::ULE) -> Self
fn from_unaligned(unaligned: Self::ULE) -> Self
source§impl Clone for FieldLength
impl Clone for FieldLength
source§fn clone(&self) -> FieldLength
fn clone(&self) -> FieldLength
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for FieldLength
impl Debug for FieldLength
source§impl Ord for FieldLength
impl Ord for FieldLength
source§fn cmp(&self, other: &FieldLength) -> Ordering
fn cmp(&self, other: &FieldLength) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
source§impl PartialEq for FieldLength
impl PartialEq for FieldLength
source§impl PartialOrd for FieldLength
impl PartialOrd for FieldLength
impl Copy for FieldLength
impl Eq for FieldLength
impl StructuralPartialEq for FieldLength
Auto Trait Implementations§
impl Freeze for FieldLength
impl RefUnwindSafe for FieldLength
impl Send for FieldLength
impl Sync for FieldLength
impl Unpin for FieldLength
impl UnwindSafe for FieldLength
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> 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)
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>
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