[−][src]Type Definition uom::si::angle::Angle
type Angle<U, V> = Quantity<Dimension, U, V>;
Implementations
impl<U: ?Sized, V> Angle<U, V> where
U: Units<V>,
V: Num + Conversion<V>,
[src]
U: Units<V>,
V: Num + Conversion<V>,
pub fn new<N>(v: V) -> Self where
N: Unit + Conversion<V, T = V::T>,
[src]
N: Unit + Conversion<V, T = V::T>,
pub fn get<N>(&self) -> V where
N: Unit + Conversion<V, T = V::T>,
[src]
N: Unit + Conversion<V, T = V::T>,
pub fn floor<N>(self) -> Self where
V: Float,
N: Unit + Conversion<V, T = V::T>,
[src]
V: Float,
N: Unit + Conversion<V, T = V::T>,
Returns the largest integer less than or equal to a number in the given measurement unit.
Generic Parameters
N
: Unit.
pub fn ceil<N>(self) -> Self where
V: Float,
N: Unit + Conversion<V, T = V::T>,
[src]
V: Float,
N: Unit + Conversion<V, T = V::T>,
Returns the smallest integer less than or equal to a number in the given measurement unit.
Generic Parameters
N
: Unit.
pub fn round<N>(self) -> Self where
V: Float,
N: Unit + Conversion<V, T = V::T>,
[src]
V: Float,
N: Unit + Conversion<V, T = V::T>,
Returns the nearest integer to a number in the in given measurement unit. Round half-way cases away from 0.0.
Generic Parameters
N
: Unit.
pub fn trunc<N>(self) -> Self where
V: Float,
N: Unit + Conversion<V, T = V::T>,
[src]
V: Float,
N: Unit + Conversion<V, T = V::T>,
pub fn fract<N>(self) -> Self where
V: Float,
N: Unit + Conversion<V, T = V::T>,
[src]
V: Float,
N: Unit + Conversion<V, T = V::T>,
pub fn format_args<N>(unit: N, style: DisplayStyle) -> Arguments<Dimension, N> where
N: Unit,
[src]
N: Unit,
Creates a struct that can be used to format a compatible quantity for display.
Notes
The return value of this method cannot be used to print directly, but is instead used to format quantities and can be reused; see Arguments::with and the examples below.
If you do not need to format multiple quantities, consider using
into_format_args
instead.
Examples
let t1 = Time::new::<femtosecond>(1.0_E-1); let t2 = Time::new::<picosecond>(1.0_E-1); let a = Time::format_args(femtosecond, Description); assert_eq!("0.1 femtoseconds", format!("{}", a.with(t1))); assert_eq!("100 femtoseconds", format!("{}", a.with(t2)));
Generic Parameters
N
: Unit.
pub fn into_format_args<N>(
self,
unit: N,
style: DisplayStyle
) -> QuantityArguments<Dimension, U, V, N> where
N: Unit,
[src]
self,
unit: N,
style: DisplayStyle
) -> QuantityArguments<Dimension, U, V, N> where
N: Unit,
Creates a struct that formats self
for display.
Notes
Unlike format_args
, the return value of this method can be
used directly for display. It will format the value of self
for the quantity on
which it is called and nothing else.
If you wish to reuse the return value to format multiple quantities, use
format_args
instead.
Examples
let t = Time::new::<picosecond>(1.0_E-1); let a = t.into_format_args(femtosecond, Description); assert_eq!("100 femtoseconds", format!("{}", a));
Generic Parameters
N
: Unit.
impl<U: ?Sized, V> Angle<U, V> where
U: Units<V>,
V: Float + Conversion<V>,
[src]
U: Units<V>,
V: Float + Conversion<V>,
Implementation of various stdlib trigonometric functions
pub fn cos(self) -> Ratio<U, V>
[src]
Computes the value of the cosine of the angle.
pub fn cosh(self) -> Ratio<U, V>
[src]
Computes the value of the hyperbolic cosine of the angle.
pub fn sin(self) -> Ratio<U, V>
[src]
Computes the value of the sine of the angle.
pub fn sinh(self) -> Ratio<U, V>
[src]
Computes the value of the hyperbolic sine of the angle.
pub fn sin_cos(self) -> (Ratio<U, V>, Ratio<U, V>)
[src]
Computes the value of both the sine and cosine of the angle.
pub fn tan(self) -> Ratio<U, V>
[src]
Computes the value of the tangent of the angle.
pub fn tanh(self) -> Ratio<U, V>
[src]
Computes the value of the hyperbolic tangent of the angle.
Trait Implementations
impl<U: ?Sized, V> From<V> for Angle<U, V> where
U: Units<V>,
V: Num + Conversion<V>,
[src]
U: Units<V>,
V: Num + Conversion<V>,
impl<U: ?Sized> FromStr for Angle<U, usize> where
U: Units<usize>,
[src]
U: Units<usize>,
type Err = ParseQuantityError
The associated error which can be returned from parsing.
fn from_str(s: &str) -> Result<Self, Self::Err>
[src]
impl<U: ?Sized> FromStr for Angle<U, u8> where
U: Units<u8>,
[src]
U: Units<u8>,
type Err = ParseQuantityError
The associated error which can be returned from parsing.
fn from_str(s: &str) -> Result<Self, Self::Err>
[src]
impl<U: ?Sized> FromStr for Angle<U, i64> where
U: Units<i64>,
[src]
U: Units<i64>,
type Err = ParseQuantityError
The associated error which can be returned from parsing.
fn from_str(s: &str) -> Result<Self, Self::Err>
[src]
impl<U: ?Sized> FromStr for Angle<U, i128> where
U: Units<i128>,
[src]
U: Units<i128>,
type Err = ParseQuantityError
The associated error which can be returned from parsing.
fn from_str(s: &str) -> Result<Self, Self::Err>
[src]
impl<U: ?Sized> FromStr for Angle<U, BigInt> where
U: Units<BigInt>,
[src]
U: Units<BigInt>,
type Err = ParseQuantityError
The associated error which can be returned from parsing.
fn from_str(s: &str) -> Result<Self, Self::Err>
[src]
impl<U: ?Sized> FromStr for Angle<U, BigUint> where
U: Units<BigUint>,
[src]
U: Units<BigUint>,
type Err = ParseQuantityError
The associated error which can be returned from parsing.
fn from_str(s: &str) -> Result<Self, Self::Err>
[src]
impl<U: ?Sized> FromStr for Angle<U, Rational> where
U: Units<Rational>,
[src]
U: Units<Rational>,
type Err = ParseQuantityError
The associated error which can be returned from parsing.
fn from_str(s: &str) -> Result<Self, Self::Err>
[src]
impl<U: ?Sized> FromStr for Angle<U, Rational32> where
U: Units<Rational32>,
[src]
U: Units<Rational32>,
type Err = ParseQuantityError
The associated error which can be returned from parsing.
fn from_str(s: &str) -> Result<Self, Self::Err>
[src]
impl<U: ?Sized> FromStr for Angle<U, Rational64> where
U: Units<Rational64>,
[src]
U: Units<Rational64>,
type Err = ParseQuantityError
The associated error which can be returned from parsing.
fn from_str(s: &str) -> Result<Self, Self::Err>
[src]
impl<U: ?Sized> FromStr for Angle<U, BigRational> where
U: Units<BigRational>,
[src]
U: Units<BigRational>,
type Err = ParseQuantityError
The associated error which can be returned from parsing.
fn from_str(s: &str) -> Result<Self, Self::Err>
[src]
impl<U: ?Sized> FromStr for Angle<U, f32> where
U: Units<f32>,
[src]
U: Units<f32>,
type Err = ParseQuantityError
The associated error which can be returned from parsing.
fn from_str(s: &str) -> Result<Self, Self::Err>
[src]
impl<U: ?Sized> FromStr for Angle<U, f64> where
U: Units<f64>,
[src]
U: Units<f64>,
type Err = ParseQuantityError
The associated error which can be returned from parsing.
fn from_str(s: &str) -> Result<Self, Self::Err>
[src]
impl<U: ?Sized> FromStr for Angle<U, u16> where
U: Units<u16>,
[src]
U: Units<u16>,
type Err = ParseQuantityError
The associated error which can be returned from parsing.
fn from_str(s: &str) -> Result<Self, Self::Err>
[src]
impl<U: ?Sized> FromStr for Angle<U, u32> where
U: Units<u32>,
[src]
U: Units<u32>,
type Err = ParseQuantityError
The associated error which can be returned from parsing.
fn from_str(s: &str) -> Result<Self, Self::Err>
[src]
impl<U: ?Sized> FromStr for Angle<U, u64> where
U: Units<u64>,
[src]
U: Units<u64>,
type Err = ParseQuantityError
The associated error which can be returned from parsing.
fn from_str(s: &str) -> Result<Self, Self::Err>
[src]
impl<U: ?Sized> FromStr for Angle<U, u128> where
U: Units<u128>,
[src]
U: Units<u128>,
type Err = ParseQuantityError
The associated error which can be returned from parsing.
fn from_str(s: &str) -> Result<Self, Self::Err>
[src]
impl<U: ?Sized> FromStr for Angle<U, isize> where
U: Units<isize>,
[src]
U: Units<isize>,
type Err = ParseQuantityError
The associated error which can be returned from parsing.
fn from_str(s: &str) -> Result<Self, Self::Err>
[src]
impl<U: ?Sized> FromStr for Angle<U, i8> where
U: Units<i8>,
[src]
U: Units<i8>,
type Err = ParseQuantityError
The associated error which can be returned from parsing.
fn from_str(s: &str) -> Result<Self, Self::Err>
[src]
impl<U: ?Sized> FromStr for Angle<U, i16> where
U: Units<i16>,
[src]
U: Units<i16>,
type Err = ParseQuantityError
The associated error which can be returned from parsing.
fn from_str(s: &str) -> Result<Self, Self::Err>
[src]
impl<U: ?Sized> FromStr for Angle<U, i32> where
U: Units<i32>,
[src]
U: Units<i32>,