PartEraBuilder

Struct PartEraBuilder 

Source
pub struct PartEraBuilder<'vf, T: ValueFormatTrait> { /* private fields */ }
Expand description

The number:era element specifies an era in which a year is counted.

The number:era element is usable within the following element:

  • number:date-style 16.27.10.

The number:era element has the following attributes:

  • number:calendar 19.341 and
  • number:style 19.358.4.

The number:era element has no child elements

Implementations§

Source§

impl<'vf, T: ValueFormatTrait> PartEraBuilder<'vf, T>

Source

pub fn new<'a>(valueformat: &'a mut T) -> Self
where 'a: 'vf,

New builder for the valueformat.

Source

pub fn build(self)

Appends the constructed FormatPart to the original value format.

Source

pub fn if_then<F>(self, test: bool, build: F) -> Self
where F: Fn(Self) -> Self,

Only applies the builder if the test is true.

Source

pub fn long_style(self) -> Self

The number:style attribute specifies whether the content of a time element is displayed in short or long format. The value of this attribute can be short or long. The meaning of these values depends on the value of the number:format-source 19.348 attribute that is attached to a date or time style.

Source

pub fn short_style(self) -> Self

The number:style attribute specifies whether the content of a time element is displayed in short or long format. The value of this attribute can be short or long. The meaning of these values depends on the value of the number:format-source 19.348 attribute that is attached to a date or time style.

Source

pub fn style(self, style: FormatNumberStyle) -> Self

The number:style attribute specifies whether the content of a time element is displayed in short or long format. The value of this attribute can be short or long. The meaning of these values depends on the value of the number:format-source 19.348 attribute that is attached to a date or time style.

Source

pub fn calendar(self, calendar: FormatCalendarStyle) -> Self

The number:calendar attribute specifies the calendar system used to extract parts of a date.

The attribute value may also be a string value. If this attribute is not specified, the default calendar system for the locale of the data style is used.

Trait Implementations§

Source§

impl<'vf, T: Debug + ValueFormatTrait> Debug for PartEraBuilder<'vf, T>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'vf, T> Freeze for PartEraBuilder<'vf, T>

§

impl<'vf, T> RefUnwindSafe for PartEraBuilder<'vf, T>
where T: RefUnwindSafe,

§

impl<'vf, T> Send for PartEraBuilder<'vf, T>
where T: Send,

§

impl<'vf, T> Sync for PartEraBuilder<'vf, T>
where T: Sync,

§

impl<'vf, T> Unpin for PartEraBuilder<'vf, T>

§

impl<'vf, T> !UnwindSafe for PartEraBuilder<'vf, T>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.