Struct icu_datetime::fieldsets::builder::FieldSetBuilder
source · #[non_exhaustive]pub struct FieldSetBuilder {
pub length: Option<Length>,
pub date_fields: Option<DateFields>,
pub time_precision: Option<TimePrecision>,
pub zone_style: Option<ZoneStyle>,
pub alignment: Option<Alignment>,
pub year_style: Option<YearStyle>,
}
Expand description
A builder for dynamic field sets.
This builder is useful if you do not know the field set at code compilation time. If you do, the static field set APIs should yield smaller binary size.
For examples, see the module docs.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. }
syntax; cannot be matched against without a wildcard ..
; and struct update syntax will not work.length: Option<Length>
The length of a formatted date/time string.
If None
, defaults to Length::Medium
.
date_fields: Option<DateFields>
The set of date fields, such as “year and month” or “weekday”.
If None
, a date will not be displayed.
time_precision: Option<TimePrecision>
The precision to display the time of day.
If None
, a time will not be displayed.
zone_style: Option<ZoneStyle>
The style to display the time zone.
If None
, a time zone will not be displayed.
alignment: Option<Alignment>
The alignment context, such as when displaying dates in a table.
This option may be specified only if the field set can honor it.
year_style: Option<YearStyle>
How to display the year and era.
This option may be specified only if the year is included in Self::date_fields
.
Implementations§
source§impl FieldSetBuilder
impl FieldSetBuilder
sourcepub fn build_date(self) -> Result<DateFieldSet, BuilderError>
pub fn build_date(self) -> Result<DateFieldSet, BuilderError>
Builds a DateFieldSet
.
An error will occur if incompatible fields or options were set in the builder.
sourcepub fn build_time(self) -> Result<TimeFieldSet, BuilderError>
pub fn build_time(self) -> Result<TimeFieldSet, BuilderError>
Builds a TimeFieldSet
.
An error will occur if incompatible fields or options were set in the builder.
sourcepub fn build_zone(self) -> Result<ZoneFieldSet, BuilderError>
pub fn build_zone(self) -> Result<ZoneFieldSet, BuilderError>
Builds a ZoneFieldSet
.
An error will occur if incompatible fields or options were set in the builder.
sourcepub fn build_date_and_time(self) -> Result<DateAndTimeFieldSet, BuilderError>
pub fn build_date_and_time(self) -> Result<DateAndTimeFieldSet, BuilderError>
Builds a DateAndTimeFieldSet
.
An error will occur if incompatible fields or options were set in the builder.
sourcepub fn build_composite_datetime(
self,
) -> Result<CompositeDateTimeFieldSet, BuilderError>
pub fn build_composite_datetime( self, ) -> Result<CompositeDateTimeFieldSet, BuilderError>
Builds a CompositeDateTimeFieldSet
.
An error will occur if incompatible fields or options were set in the builder.
sourcepub fn build_composite(self) -> Result<CompositeFieldSet, BuilderError>
pub fn build_composite(self) -> Result<CompositeFieldSet, BuilderError>
Builds a CompositeFieldSet
.
An error will occur if incompatible fields or options were set in the builder.
Trait Implementations§
source§impl Clone for FieldSetBuilder
impl Clone for FieldSetBuilder
source§fn clone(&self) -> FieldSetBuilder
fn clone(&self) -> FieldSetBuilder
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for FieldSetBuilder
impl Debug for FieldSetBuilder
source§impl Default for FieldSetBuilder
impl Default for FieldSetBuilder
source§fn default() -> FieldSetBuilder
fn default() -> FieldSetBuilder
source§impl PartialEq for FieldSetBuilder
impl PartialEq for FieldSetBuilder
impl Eq for FieldSetBuilder
impl StructuralPartialEq for FieldSetBuilder
Auto Trait Implementations§
impl Freeze for FieldSetBuilder
impl RefUnwindSafe for FieldSetBuilder
impl Send for FieldSetBuilder
impl Sync for FieldSetBuilder
impl Unpin for FieldSetBuilder
impl UnwindSafe for FieldSetBuilder
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