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(&self, f: &mut Formatter<'_>) -> 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(&self, f: &mut Formatter<'_>) -> 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(&self, f: &mut Formatter<'_>) -> 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(&self, f: &mut Formatter<'_>) -> 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(&self, f: &mut Formatter<'_>) -> 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(&self, f: &mut Formatter<'_>) -> 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(&self, f: &mut Formatter<'_>) -> 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(&self, f: &mut Formatter<'_>) -> 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, U, V, N> Freeze for QuantityArguments<D, U, V, N>
where V: Freeze, D: ?Sized, U: ?Sized,

§

impl<D, U, V, N> RefUnwindSafe for QuantityArguments<D, U, V, N>

§

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

§

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

§

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

§

impl<D, U, V, N> UnwindSafe for QuantityArguments<D, U, V, N>

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

§

type Output = T

Should always be Self
source§

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

§

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>,

§

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.