Struct uom::si::fmt::QuantityArguments

source ·
pub struct QuantityArguments<D, U, V, N>where
    D: Dimension + ?Sized,
    U: Units<V> + ?Sized,
    V: Num + Conversion<V>,
    N: Unit,{ /* private fields */ }
Expand description

A struct to specify a display style and unit for a given quantity.

let l = Length::new::<meter>(1.0);
let a = l.into_format_args(centimeter, Description);

assert_eq!("100 centimeters", format!("{}", a));

Generic Parameters

  • D: Dimension.
  • U: Base units.
  • V: Value underlying storage type.
  • N: Unit.

Trait Implementations§

source§

impl<D, U, V, N> Binary for QuantityArguments<D, U, V, N>where D: Dimension + ?Sized, U: Units<V> + ?Sized, V: Num + Conversion<V> + Binary, N: Unit + Conversion<V, T = V::T>,

source§

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

Formats the value using the given formatter.
source§

impl<D, U, V, N> Clone for QuantityArguments<D, U, V, N>where D: Dimension + ?Sized, U: Units<V> + ?Sized, V: Num + Conversion<V> + Clone, N: Unit,

source§

fn clone(&self) -> Self

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<D, U, V, N> Debug for QuantityArguments<D, U, V, N>where D: Dimension + ?Sized, U: Units<V> + ?Sized, V: Num + Conversion<V> + Debug, N: Unit + Conversion<V, T = V::T>,

source§

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

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

impl<D, U, V, N> Display for QuantityArguments<D, U, V, N>where D: Dimension + ?Sized, U: Units<V> + ?Sized, V: Num + Conversion<V> + Display, N: Unit + Conversion<V, T = V::T>,

source§

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

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

impl<D, U, V, N> LowerExp for QuantityArguments<D, U, V, N>where D: Dimension + ?Sized, U: Units<V> + ?Sized, V: Num + Conversion<V> + LowerExp, N: Unit + Conversion<V, T = V::T>,

source§

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

Formats the value using the given formatter.
source§

impl<D, U, V, N> LowerHex for QuantityArguments<D, U, V, N>where D: Dimension + ?Sized, U: Units<V> + ?Sized, V: Num + Conversion<V> + LowerHex, N: Unit + Conversion<V, T = V::T>,

source§

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

Formats the value using the given formatter.
source§

impl<D, U, V, N> Octal for QuantityArguments<D, U, V, N>where D: Dimension + ?Sized, U: Units<V> + ?Sized, V: Num + Conversion<V> + Octal, N: Unit + Conversion<V, T = V::T>,

source§

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

Formats the value using the given formatter.
source§

impl<D, U, V, N> UpperExp for QuantityArguments<D, U, V, N>where D: Dimension + ?Sized, U: Units<V> + ?Sized, V: Num + Conversion<V> + UpperExp, N: Unit + Conversion<V, T = V::T>,

source§

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

Formats the value using the given formatter.
source§

impl<D, U, V, N> UpperHex for QuantityArguments<D, U, V, N>where D: Dimension + ?Sized, U: Units<V> + ?Sized, V: Num + Conversion<V> + UpperHex, N: Unit + Conversion<V, T = V::T>,

source§

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

Formats the value using the given formatter.
source§

impl<D, U, V, N> Copy for QuantityArguments<D, U, V, N>where D: Dimension + ?Sized, U: Units<V> + ?Sized, V: Num + Conversion<V> + Copy, N: Unit,

Auto Trait Implementations§

§

impl<D: ?Sized, U: ?Sized, V, N> RefUnwindSafe for QuantityArguments<D, U, V, N>where N: RefUnwindSafe, V: RefUnwindSafe,

§

impl<D: ?Sized, U: ?Sized, V, N> Send for QuantityArguments<D, U, V, N>where N: Send, V: Send,

§

impl<D: ?Sized, U: ?Sized, V, N> Sync for QuantityArguments<D, U, V, N>where N: Sync, V: Sync,

§

impl<D: ?Sized, U: ?Sized, V, N> Unpin for QuantityArguments<D, U, V, N>where N: Unpin, V: Unpin,

§

impl<D: ?Sized, U: ?Sized, V, N> UnwindSafe for QuantityArguments<D, U, V, N>where N: UnwindSafe, V: UnwindSafe,

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> Same<T> for T

§

type Output = T

Should always be Self
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> ToString for Twhere T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. 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.