PartMonthBuilder

Struct PartMonthBuilder 

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

Builder for FormatPart with type Month.

The number:month element specifies a month in a date.

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

  • number:date-style 16.27.10.

The number:month element has the following attributes: number:calendar 19.341, number:possessive-form 19.355, number:style 19.358.7 and number:textual 19.359.

The number:month element has no child elements

Implementations§

Source§

impl<'vf, T: ValueFormatTrait> PartMonthBuilder<'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 textual(self) -> Self

The number:textual attribute specifies whether the name or number of a month is displayed in the month portion of a date.

The defined values for the number:textual element are:

  • false: the number of the month is displayed.
  • true: the name of the month is displayed.

The name or number of a month is defined by the number:calendar 19.341 attribute on the same parent element as the number:textual attribute. The default value for this attribute is false.

Source

pub fn possessive_form(self) -> Self

The number:possessive-form attribute specifies whether the month is displayed as a noun or using the possessive form. The number:possessive-form attribute is only applied when a number:textual 19.363 attribute on the same number:month element has the value of true.

The defined values for the number:possessive-form attribute are:

  • false: the name of the month is displayed in nominative form.
  • true: the name of the month is displayed in possessive form.
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 PartMonthBuilder<'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 PartMonthBuilder<'vf, T>

§

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

§

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

§

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

§

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

§

impl<'vf, T> !UnwindSafe for PartMonthBuilder<'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.