Enum icu_datetime::fields::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
Trait Implementations§
source§impl AsULE for FieldLength
impl AsULE for FieldLength
source§impl Bake for FieldLength
impl Bake for FieldLength
source§fn bake(&self, env: &CrateEnv) -> TokenStream
fn bake(&self, env: &CrateEnv) -> TokenStream
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<'de> Deserialize<'de> for FieldLength
impl<'de> Deserialize<'de> for FieldLength
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where __D: Deserializer<'de>,
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§fn eq(&self, other: &FieldLength) -> bool
fn eq(&self, other: &FieldLength) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd for FieldLength
impl PartialOrd for FieldLength
source§fn partial_cmp(&self, other: &FieldLength) -> Option<Ordering>
fn partial_cmp(&self, other: &FieldLength) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read more