[][src]Struct dynfmt::ArgumentSpec

pub struct ArgumentSpec<'a> { /* fields omitted */ }

The format specification for a single argument in the format string, created by Format::iter_args.

The argument spec may borrow data from the format string, e.g. when referring to named arguments in the argument list.

Methods

impl<'a> ArgumentSpec<'a>
[src]

pub fn new(start: usize, end: usize) -> Self
[src]

Creates a new argument specification with default values.

The start and end parameters denote the exclusive range of this specification in the format string. E.g. for a format string "{}", the range is [0, 2).

pub fn with_position(self, position: Position<'a>) -> Self
[src]

Sets the argument position. Defaults to Position::Auto.

pub fn with_format(self, format: FormatType) -> Self
[src]

Sets the formatting type. Defaults to FormatType::Display.

pub fn with_alternate(self, alternate: bool) -> Self
[src]

Switch the formatter to alternate mode.

pub fn with_sign(self, sign: bool) -> Self
[src]

Always print a sign characters in front of numbers.

pub fn with_zeros(self, pad_zero: bool) -> Self
[src]

Activate sign-aware zero padding.

pub fn with_fill(self, fill_char: char) -> Self
[src]

Set the fill character. Defaults to ' ' (a space).

pub fn with_alignment(self, alignment: Alignment) -> Self
[src]

Set alignment within the width of this format. Defaults to Alignment::Right.

pub fn with_width(self, width: Option<Count<'a>>) -> Self
[src]

Set a minimum width for this argument. Defaults to None.

If the formatted argument is smaller than the threshold, the argument is padded with the fill character. If the argument is numeric and with_zeros is specified, it is padded with zeros instead.

pub fn with_precision(self, precision: Option<Count<'a>>) -> Self
[src]

Set the precision for floating point values. Defaults to arbitrary precision.

pub fn start(&self) -> usize
[src]

The start index of this specification in the format string.

pub fn end(&self) -> usize
[src]

The end index of this specification in the format string.

Trait Implementations

impl<'a> Debug for ArgumentSpec<'a>
[src]

Auto Trait Implementations

impl<'a> Send for ArgumentSpec<'a>

impl<'a> Sync for ArgumentSpec<'a>

Blanket Implementations

impl<T> From for T
[src]

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom for T where
    T: From<U>, 
[src]

type Error = !

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

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

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Any for T where
    T: 'static + ?Sized
[src]