Struct PartHoursBuilder

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

The number:hours element specifies whether hours are displayed as part of a date or time.

The number:hours element is usable within the following elements:

  • number:datestyle 16.27.10 and
  • number:time-style 16.27.18.

The number:hours element has the following attribute:

  • number:style 19.358.5.

The number:hours element has no child elements.

Implementations§

Source§

impl<'vf, T: ValueFormatTrait> PartHoursBuilder<'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.

Trait Implementations§

Source§

impl<'vf, T: Debug + ValueFormatTrait> Debug for PartHoursBuilder<'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 PartHoursBuilder<'vf, T>

§

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

§

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

§

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

§

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

§

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