Skip to main content

Arguments

Struct Arguments 

Source
pub struct Arguments<'ct> {
    pub template: &'ct Template,
    /* private fields */
}
Expand description

Main structure to enrich the template with values and format the template to the end result.

Fields§

§template: &'ct Template

Implementations§

Source§

impl<'ct> Arguments<'ct>

Source

pub fn new(template: &'ct Template) -> Self

Create a new container from a precompiled template.

Source

pub fn clear(&mut self)

Clear the argument values again

Source

pub fn format(&self) -> Result<String, Error>

Attempt to format the template with the provided values.

Source

pub fn add_argument_value<K: ToArgumentKey>( &mut self, key: K, value: ArgumentValue<'ct>, ) -> Result<(), Error>

Attempts to add an argument and checks for duplicate argument values.

Source

pub fn add_argument_value_unchecked<K: ToArgumentKey>( &mut self, key: K, value: ArgumentValue<'ct>, )

Adds an argument but does not execute any checks.

Source

pub fn builder(self) -> Result<Self, Error>

Transitions into the checked ArgumentsBuilder.

Trait Implementations§

Source§

impl<'ct> Debug for Arguments<'ct>

Source§

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

Formats the value using the given formatter. Read more
Source§

impl<'a> UncheckedArgumentsBuilder<'a> for Arguments<'a>

Source§

fn argument_value_unchecked<K: ToArgumentKey>( self, key: K, value: ArgumentValue<'a>, ) -> Arguments<'a>

Source§

fn display_unchecked<T: Display, K: ToArgumentKey>( self, key: K, value: &'a T, ) -> Arguments<'a>

Source§

fn debug_unchecked<T: Debug, K: ToArgumentKey>( self, key: K, value: &'a T, ) -> Arguments<'a>

Source§

fn binary_unchecked<T: Binary, K: ToArgumentKey>( self, key: K, value: &'a T, ) -> Arguments<'a>

Source§

fn octal_unchecked<T: Octal, K: ToArgumentKey>( self, key: K, value: &'a T, ) -> Arguments<'a>

Source§

fn pointer_unchecked<T: Pointer, K: ToArgumentKey>( self, key: K, value: &'a T, ) -> Arguments<'a>

Source§

fn lower_exp_unchecked<T: LowerExp, K: ToArgumentKey>( self, key: K, value: &'a T, ) -> Arguments<'a>

Source§

fn upper_exp_unchecked<T: UpperExp, K: ToArgumentKey>( self, key: K, value: &'a T, ) -> Arguments<'a>

Source§

fn lower_hex_unchecked<T: LowerHex, K: ToArgumentKey>( self, key: K, value: &'a T, ) -> Arguments<'a>

Source§

fn upper_hex_unchecked<T: UpperHex, K: ToArgumentKey>( self, key: K, value: &'a T, ) -> Arguments<'a>

Source§

fn width_or_precision_amount_unchecked<T: WidthOrPrecisionAmount, K: ToArgumentKey>( self, key: K, value: &'a T, ) -> Self

Auto Trait Implementations§

§

impl<'ct> Freeze for Arguments<'ct>

§

impl<'ct> !RefUnwindSafe for Arguments<'ct>

§

impl<'ct> !Send for Arguments<'ct>

§

impl<'ct> !Sync for Arguments<'ct>

§

impl<'ct> Unpin for Arguments<'ct>

§

impl<'ct> !UnwindSafe for Arguments<'ct>

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.