pub struct Formattable<'a> { /* private fields */ }
Expand description

Utility struct holding references to the trait implementation of a value to enable runtime verification and execution of them

Implementations§

source§

impl<'a> Formattable<'a>

source

pub fn debug_display<T: Debug + Display>(value: &'a T) -> Self

Available on crate feature debug only.

Creates a Formattable from a value implementing Debug and Display

source

pub fn and_debug_display<T: Debug + Display>(self, value: &'a T) -> Self

Available on crate feature debug only.

Adds implementation for Debug and Display

source

pub fn set_debug_display<T: Debug + Display>(&mut self, value: &'a T)

Available on crate feature debug only.

Sets implementation for Debug and Display

source

pub fn debug<T: Debug>(value: &'a T) -> Self

Available on crate feature debug only.

Creates a Formattable from a value implementing Debug

source

pub fn and_debug<T: Debug>(self, value: &'a T) -> Self

Available on crate feature debug only.

Adds implementation for Debug

source

pub fn set_debug<T: Debug>(&mut self, value: &'a T)

Available on crate feature debug only.

Sets implementation for Debug

source

pub fn display<T: Display>(value: &'a T) -> Self

Creates a Formattable from a value implementing Display

source

pub fn and_display<T: Display>(self, value: &'a T) -> Self

Adds implementation for Display

source

pub fn set_display<T: Display>(&mut self, value: &'a T)

Sets implementation for Display

source

pub fn integer<T: Binary + Debug + Display + LowerExp + LowerHex + Octal + UpperExp + UpperHex>( value: &'a T ) -> Self

Available on crate feature number only.

Creates a Formattable from a value implementing Debug, Display, Octal, LowerHex, UpperHex, Binary, LowerExp and UpperExp

source

pub fn and_integer<T: Binary + Debug + Display + LowerExp + LowerHex + Octal + UpperExp + UpperHex>( self, value: &'a T ) -> Self

Available on crate feature number only.

Adds implementation for Debug, Display, Octal, LowerHex, UpperHex, Binary, LowerExp and UpperExp

source

pub fn set_integer<T: Binary + Debug + Display + LowerExp + LowerHex + Octal + UpperExp + UpperHex>( &mut self, value: &'a T )

Available on crate feature number only.

Sets implementation for Debug, Display, Octal, LowerHex, UpperHex, Binary, LowerExp and UpperExp

source

pub fn float<T: Debug + Display + LowerExp + UpperExp>(value: &'a T) -> Self

Available on crate feature number only.

Creates a Formattable from a value implementing Debug, Display, LowerExp and UpperExp

source

pub fn and_float<T: Debug + Display + LowerExp + UpperExp>( self, value: &'a T ) -> Self

Available on crate feature number only.

Adds implementation for Debug, Display, LowerExp and UpperExp

source

pub fn set_float<T: Debug + Display + LowerExp + UpperExp>( &mut self, value: &'a T )

Available on crate feature number only.

Sets implementation for Debug, Display, LowerExp and UpperExp

source

pub fn binary<T: Binary>(value: &'a T) -> Self

Available on crate feature number only.

Creates a Formattable from a value implementing Binary

source

pub fn and_binary<T: Binary>(self, value: &'a T) -> Self

Available on crate feature number only.

Adds implementation for Binary

source

pub fn set_binary<T: Binary>(&mut self, value: &'a T)

Available on crate feature number only.

Sets implementation for Binary

source

pub fn lower_exp<T: LowerExp>(value: &'a T) -> Self

Available on crate feature number only.

Creates a Formattable from a value implementing LowerExp

source

pub fn and_lower_exp<T: LowerExp>(self, value: &'a T) -> Self

Available on crate feature number only.

Adds implementation for LowerExp

source

pub fn set_lower_exp<T: LowerExp>(&mut self, value: &'a T)

Available on crate feature number only.

Sets implementation for LowerExp

source

pub fn lower_hex<T: LowerHex>(value: &'a T) -> Self

Available on crate feature number only.

Creates a Formattable from a value implementing LowerHex

source

pub fn and_lower_hex<T: LowerHex>(self, value: &'a T) -> Self

Available on crate feature number only.

Adds implementation for LowerHex

source

pub fn set_lower_hex<T: LowerHex>(&mut self, value: &'a T)

Available on crate feature number only.

Sets implementation for LowerHex

source

pub fn octal<T: Octal>(value: &'a T) -> Self

Available on crate feature number only.

Creates a Formattable from a value implementing Octal

source

pub fn and_octal<T: Octal>(self, value: &'a T) -> Self

Available on crate feature number only.

Adds implementation for Octal

source

pub fn set_octal<T: Octal>(&mut self, value: &'a T)

Available on crate feature number only.

Sets implementation for Octal

source

pub fn upper_exp<T: UpperExp>(value: &'a T) -> Self

Available on crate feature number only.

Creates a Formattable from a value implementing UpperExp

source

pub fn and_upper_exp<T: UpperExp>(self, value: &'a T) -> Self

Available on crate feature number only.

Adds implementation for UpperExp

source

pub fn set_upper_exp<T: UpperExp>(&mut self, value: &'a T)

Available on crate feature number only.

Sets implementation for UpperExp

source

pub fn upper_hex<T: UpperHex>(value: &'a T) -> Self

Available on crate feature number only.

Creates a Formattable from a value implementing UpperHex

source

pub fn and_upper_hex<T: UpperHex>(self, value: &'a T) -> Self

Available on crate feature number only.

Adds implementation for UpperHex

source

pub fn set_upper_hex<T: UpperHex>(&mut self, value: &'a T)

Available on crate feature number only.

Sets implementation for UpperHex

source§

impl<'a> Formattable<'a>

source

pub fn pointer<T: Pointer>(value: &'a T) -> Self

Available on crate feature pointer only.

Creates a Formattable from a value implementing Pointer.

source

pub fn and_pointer<T: Pointer>(self, value: &'a T) -> Self

Available on crate feature pointer only.

Adds implementation for Pointer

source

pub fn set_pointer<T: Pointer>(&mut self, value: &'a T)

Available on crate feature pointer only.

Sets implementation for Pointer

source§

impl<'a> Formattable<'a>

source

pub fn iter(value: &'a [Formattable<'a>]) -> Self

Available on crate feature iter only.

Creates a Formattable from a list of values

source

pub fn and_iter(self, value: &'a [Formattable<'a>]) -> Self

Available on crate feature iter only.

Adds implementation for mapping operations

source

pub fn set_iter(&mut self, value: &'a [Formattable<'a>])

Available on crate feature iter only.

Sets implementation for mapping operations

Trait Implementations§

source§

impl<'a> Clone for Formattable<'a>

source§

fn clone(&self) -> Formattable<'a>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Formattable<'_>

source§

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

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

impl<'a> Default for Formattable<'a>

source§

fn default() -> Formattable<'a>

Returns the “default value” for a type. Read more
source§

impl<'a> Copy for Formattable<'a>

Auto Trait Implementations§

§

impl<'a> !RefUnwindSafe for Formattable<'a>

§

impl<'a> !Send for Formattable<'a>

§

impl<'a> !Sync for Formattable<'a>

§

impl<'a> Unpin for Formattable<'a>

§

impl<'a> !UnwindSafe for Formattable<'a>

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

const: unstable · source§

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

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

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

const: unstable · 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> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

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

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

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

Performs the conversion.
source§

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

§

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

The type returned in the event of a conversion error.
const: unstable · source§

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

Performs the conversion.