Skip to main content

SignedUnitInterval

Struct SignedUnitInterval 

Source
pub struct SignedUnitInterval<T = f32>(/* private fields */);
Expand description

A floating-point value constrained to the closed signed unit interval [-1, 1].

SignedUnitInterval is useful for normalized signed values such as direction, balance, centered offsets, joystick axes, and correlation-like coefficients.

Implementations§

Source§

impl<T: UnitIntervalFloat> SignedUnitInterval<T>

Source

pub const NEG_ONE: Self

The lower bound of the signed unit interval.

Source

pub const ZERO: Self

The midpoint of the signed unit interval.

Source

pub const ONE: Self

The upper bound of the signed unit interval.

Source

pub const HALF: Self

The positive midpoint of the signed unit interval.

Source

pub fn new(v: T) -> Option<Self>

Creates a value if v is inside [-1, 1].

Returns None for values outside the interval and for NaN.

Source

pub const unsafe fn new_unchecked(v: T) -> Self

Available on crate feature unsafe only.

Creates a value without checking that v is inside [-1, 1].

§Safety

The caller must guarantee that v is greater than or equal to negative one, less than or equal to one, and not NaN.

Source

pub fn contains(v: T) -> bool

Returns whether v is inside [-1, 1].

NaN is not contained in the interval.

Source

pub fn saturating(v: T) -> Self

Creates a value by clamping v into [-1, 1].

NaN is treated as zero.

Source

pub const fn get(self) -> T

Returns the inner floating-point value.

Source

pub const fn into_inner(self) -> T

Consumes the wrapper and returns the inner floating-point value.

Source

pub fn is_zero(self) -> bool

Returns whether this value is exactly zero.

Source

pub fn is_one(self) -> bool

Returns whether this value is exactly one.

Source

pub fn is_neg_one(self) -> bool

Returns whether this value is exactly negative one.

Source

pub fn complement(self) -> T

Returns 1 - self.

Source

pub fn min<R: Into<Self>>(self, rhs: R) -> Self

Returns the smaller of two signed unit interval values.

Source

pub fn max<R: Into<Self>>(self, rhs: R) -> Self

Returns the larger of two signed unit interval values.

Source

pub fn midpoint<R: Into<Self>>(self, rhs: R) -> Self

Returns the midpoint between two signed unit interval values.

Source

pub fn distance_to<R: Into<Self>>(self, rhs: R) -> T

Returns the absolute distance between two signed unit interval values.

Source

pub fn checked_add<R: Into<Self>>(self, rhs: R) -> Option<Self>

Adds two values, returning None if the result is outside [-1, 1].

Source

pub unsafe fn add_unchecked<R: Into<Self>>(self, rhs: R) -> Self

Available on crate feature unsafe only.

Adds two values without checking that the result is inside [-1, 1].

§Safety

The caller must guarantee that self + rhs is inside [-1, 1] and not NaN.

Source

pub fn saturating_add<R: Into<Self>>(self, rhs: R) -> Self

Adds two values and clamps the result into [-1, 1].

Source

pub fn checked_sub<R: Into<Self>>(self, rhs: R) -> Option<Self>

Subtracts rhs, returning None if the result is outside [-1, 1].

Source

pub unsafe fn sub_unchecked<R: Into<Self>>(self, rhs: R) -> Self

Available on crate feature unsafe only.

Subtracts rhs without checking that the result is inside [-1, 1].

§Safety

The caller must guarantee that self - rhs is inside [-1, 1] and not NaN.

Source

pub fn saturating_sub<R: Into<Self>>(self, rhs: R) -> Self

Subtracts rhs and clamps the result into [-1, 1].

Source

pub fn checked_div<R: Into<Self>>(self, rhs: R) -> Option<Self>

Divides by rhs, returning None if the result is outside [-1, 1].

Source

pub unsafe fn div_unchecked<R: Into<Self>>(self, rhs: R) -> Self

Available on crate feature unsafe only.

Divides by rhs without checking that the result is inside [-1, 1].

§Safety

The caller must guarantee that self / rhs is inside [-1, 1] and not NaN.

Source

pub fn saturating_div<R: Into<Self>>(self, rhs: R) -> Self

Divides by rhs and clamps the result into [-1, 1].

Source

pub fn checked_scale(self, factor: T) -> Option<Self>

Multiplies by an arbitrary float, returning None if the result is outside [-1, 1].

Source

pub unsafe fn scale_unchecked(self, factor: T) -> Self

Available on crate feature unsafe only.

Multiplies by an arbitrary float without checking that the result is inside [-1, 1].

§Safety

The caller must guarantee that self * factor is inside [-1, 1] and not NaN.

Source

pub fn saturating_scale(self, factor: T) -> Self

Multiplies by an arbitrary float and clamps the result into [-1, 1].

Source

pub fn lerp(self, start: T, end: T) -> T

Linearly interpolates between start and end.

Source§

impl SignedUnitInterval<f32>

Source

pub fn abs(self) -> UnitInterval<f32>

Returns the absolute value.

Source

pub fn signum(self) -> Self

Returns a number representing the sign of this value.

Source

pub fn copysign(self, sign: f32) -> Self

Returns this value with the sign of sign.

Source

pub fn is_sign_positive(self) -> bool

Returns true if this value is positive zero or positive.

Source

pub fn is_sign_negative(self) -> bool

Returns true if this value is negative zero or negative.

Source

pub fn is_finite(self) -> bool

Returns true; signed unit interval values are always finite.

Source

pub fn is_infinite(self) -> bool

Returns false; signed unit interval values cannot be infinite.

Source

pub fn is_nan(self) -> bool

Returns false; signed unit interval values cannot be NaN.

Source

pub fn recip(self) -> f32

Takes the reciprocal, 1 / self.

Source§

impl SignedUnitInterval<f32>

Source

pub fn floor(self) -> Self

Available on crate features std only.

Returns the largest integer less than or equal to this value.

Source

pub fn ceil(self) -> Self

Available on crate features std only.

Returns the smallest integer greater than or equal to this value.

Source

pub fn round(self) -> Self

Available on crate features std only.

Returns the nearest integer to this value, rounding halfway cases away from zero.

Source

pub fn trunc(self) -> Self

Available on crate features std only.

Returns the integer part of this value.

Source

pub fn fract(self) -> Self

Available on crate features std only.

Returns the fractional part of this value.

Source

pub fn powi(self, n: i32) -> f32

Available on crate features std only.

Raises this value to an integer power.

Source

pub fn powf(self, n: f32) -> f32

Available on crate features std only.

Raises this value to a floating-point power.

Source

pub fn sqrt(self) -> f32

Available on crate features std only.

Returns the square root.

Source

pub fn cbrt(self) -> Self

Available on crate features std only.

Returns the cube root.

Source

pub fn mul_add(self, a: f32, b: f32) -> f32

Available on crate features std only.

Computes self * a + b with one rounding error.

Source

pub fn div_euclid(self, rhs: f32) -> f32

Available on crate features std only.

Returns the Euclidean division of this value by rhs.

Source

pub fn rem_euclid(self, rhs: f32) -> f32

Available on crate features std only.

Returns the least non-negative remainder of this value divided by rhs.

Source

pub fn exp(self) -> f32

Available on crate features std only.

Returns e^(self).

Source

pub fn exp2(self) -> f32

Available on crate features std only.

Returns 2^(self).

Source

pub fn ln(self) -> f32

Available on crate features std only.

Returns the natural logarithm.

Source

pub fn log(self, base: f32) -> f32

Available on crate features std only.

Returns the logarithm with respect to an arbitrary base.

Source

pub fn log2(self) -> f32

Available on crate features std only.

Returns the base 2 logarithm.

Source

pub fn log10(self) -> f32

Available on crate features std only.

Returns the base 10 logarithm.

Source

pub fn sin(self) -> Self

Available on crate features std only.

Returns the sine, in radians.

Source

pub fn cos(self) -> UnitInterval<f32>

Available on crate features std only.

Returns the cosine, in radians.

Source

pub fn tan(self) -> f32

Available on crate features std only.

Returns the tangent, in radians.

Source

pub fn sin_cos(self) -> (Self, UnitInterval<f32>)

Available on crate features std only.

Returns both sine and cosine, in radians.

Source

pub fn asin(self) -> f32

Available on crate features std only.

Returns the arcsine, in radians.

Source

pub fn acos(self) -> f32

Available on crate features std only.

Returns the arccosine, in radians.

Source

pub fn atan(self) -> Self

Available on crate features std only.

Returns the arctangent, in radians.

Source

pub fn atan2(self, other: f32) -> f32

Available on crate features std only.

Returns the four-quadrant arctangent of self and other, in radians.

Source

pub fn sinh(self) -> f32

Available on crate features std only.

Returns the hyperbolic sine.

Source

pub fn cosh(self) -> f32

Available on crate features std only.

Returns the hyperbolic cosine.

Source

pub fn tanh(self) -> Self

Available on crate features std only.

Returns the hyperbolic tangent.

Source

pub fn asinh(self) -> Self

Available on crate features std only.

Returns the inverse hyperbolic sine.

Source

pub fn acosh(self) -> f32

Available on crate features std only.

Returns the inverse hyperbolic cosine.

Source

pub fn atanh(self) -> f32

Available on crate features std only.

Returns the inverse hyperbolic tangent.

Source

pub fn hypot(self, other: f32) -> f32

Available on crate features std only.

Calculates the length of the hypotenuse of a right-angle triangle.

Source§

impl SignedUnitInterval<f64>

Source

pub fn abs(self) -> UnitInterval<f64>

Returns the absolute value.

Source

pub fn signum(self) -> Self

Returns a number representing the sign of this value.

Source

pub fn copysign(self, sign: f64) -> Self

Returns this value with the sign of sign.

Source

pub fn is_sign_positive(self) -> bool

Returns true if this value is positive zero or positive.

Source

pub fn is_sign_negative(self) -> bool

Returns true if this value is negative zero or negative.

Source

pub fn is_finite(self) -> bool

Returns true; signed unit interval values are always finite.

Source

pub fn is_infinite(self) -> bool

Returns false; signed unit interval values cannot be infinite.

Source

pub fn is_nan(self) -> bool

Returns false; signed unit interval values cannot be NaN.

Source

pub fn recip(self) -> f64

Takes the reciprocal, 1 / self.

Source§

impl SignedUnitInterval<f64>

Source

pub fn floor(self) -> Self

Available on crate features std only.

Returns the largest integer less than or equal to this value.

Source

pub fn ceil(self) -> Self

Available on crate features std only.

Returns the smallest integer greater than or equal to this value.

Source

pub fn round(self) -> Self

Available on crate features std only.

Returns the nearest integer to this value, rounding halfway cases away from zero.

Source

pub fn trunc(self) -> Self

Available on crate features std only.

Returns the integer part of this value.

Source

pub fn fract(self) -> Self

Available on crate features std only.

Returns the fractional part of this value.

Source

pub fn powi(self, n: i32) -> f64

Available on crate features std only.

Raises this value to an integer power.

Source

pub fn powf(self, n: f64) -> f64

Available on crate features std only.

Raises this value to a floating-point power.

Source

pub fn sqrt(self) -> f64

Available on crate features std only.

Returns the square root.

Source

pub fn cbrt(self) -> Self

Available on crate features std only.

Returns the cube root.

Source

pub fn mul_add(self, a: f64, b: f64) -> f64

Available on crate features std only.

Computes self * a + b with one rounding error.

Source

pub fn div_euclid(self, rhs: f64) -> f64

Available on crate features std only.

Returns the Euclidean division of this value by rhs.

Source

pub fn rem_euclid(self, rhs: f64) -> f64

Available on crate features std only.

Returns the least non-negative remainder of this value divided by rhs.

Source

pub fn exp(self) -> f64

Available on crate features std only.

Returns e^(self).

Source

pub fn exp2(self) -> f64

Available on crate features std only.

Returns 2^(self).

Source

pub fn ln(self) -> f64

Available on crate features std only.

Returns the natural logarithm.

Source

pub fn log(self, base: f64) -> f64

Available on crate features std only.

Returns the logarithm with respect to an arbitrary base.

Source

pub fn log2(self) -> f64

Available on crate features std only.

Returns the base 2 logarithm.

Source

pub fn log10(self) -> f64

Available on crate features std only.

Returns the base 10 logarithm.

Source

pub fn sin(self) -> Self

Available on crate features std only.

Returns the sine, in radians.

Source

pub fn cos(self) -> UnitInterval<f64>

Available on crate features std only.

Returns the cosine, in radians.

Source

pub fn tan(self) -> f64

Available on crate features std only.

Returns the tangent, in radians.

Source

pub fn sin_cos(self) -> (Self, UnitInterval<f64>)

Available on crate features std only.

Returns both sine and cosine, in radians.

Source

pub fn asin(self) -> f64

Available on crate features std only.

Returns the arcsine, in radians.

Source

pub fn acos(self) -> f64

Available on crate features std only.

Returns the arccosine, in radians.

Source

pub fn atan(self) -> Self

Available on crate features std only.

Returns the arctangent, in radians.

Source

pub fn atan2(self, other: f64) -> f64

Available on crate features std only.

Returns the four-quadrant arctangent of self and other, in radians.

Source

pub fn sinh(self) -> f64

Available on crate features std only.

Returns the hyperbolic sine.

Source

pub fn cosh(self) -> f64

Available on crate features std only.

Returns the hyperbolic cosine.

Source

pub fn tanh(self) -> Self

Available on crate features std only.

Returns the hyperbolic tangent.

Source

pub fn asinh(self) -> Self

Available on crate features std only.

Returns the inverse hyperbolic sine.

Source

pub fn acosh(self) -> f64

Available on crate features std only.

Returns the inverse hyperbolic cosine.

Source

pub fn atanh(self) -> f64

Available on crate features std only.

Returns the inverse hyperbolic tangent.

Source

pub fn hypot(self, other: f64) -> f64

Available on crate features std only.

Calculates the length of the hypotenuse of a right-angle triangle.

Trait Implementations§

Source§

impl Add<SignedUnitInterval<f64>> for UnitInterval<f64>

Source§

type Output = f64

The resulting type after applying the + operator.
Source§

fn add(self, rhs: SignedUnitInterval<f64>) -> Self::Output

Performs the + operation. Read more
Source§

impl Add<SignedUnitInterval<f64>> for f64

Source§

type Output = f64

The resulting type after applying the + operator.
Source§

fn add(self, rhs: SignedUnitInterval<f64>) -> Self::Output

Performs the + operation. Read more
Source§

impl Add<SignedUnitInterval> for UnitInterval<f32>

Source§

type Output = f32

The resulting type after applying the + operator.
Source§

fn add(self, rhs: SignedUnitInterval<f32>) -> Self::Output

Performs the + operation. Read more
Source§

impl Add<SignedUnitInterval> for f32

Source§

type Output = f32

The resulting type after applying the + operator.
Source§

fn add(self, rhs: SignedUnitInterval<f32>) -> Self::Output

Performs the + operation. Read more
Source§

impl Add<UnitInterval<f64>> for SignedUnitInterval<f64>

Source§

type Output = f64

The resulting type after applying the + operator.
Source§

fn add(self, rhs: UnitInterval<f64>) -> Self::Output

Performs the + operation. Read more
Source§

impl Add<UnitInterval> for SignedUnitInterval<f32>

Source§

type Output = f32

The resulting type after applying the + operator.
Source§

fn add(self, rhs: UnitInterval<f32>) -> Self::Output

Performs the + operation. Read more
Source§

impl Add<f32> for SignedUnitInterval<f32>

Source§

type Output = f32

The resulting type after applying the + operator.
Source§

fn add(self, rhs: f32) -> Self::Output

Performs the + operation. Read more
Source§

impl Add<f64> for SignedUnitInterval<f64>

Source§

type Output = f64

The resulting type after applying the + operator.
Source§

fn add(self, rhs: f64) -> Self::Output

Performs the + operation. Read more
Source§

impl Add for SignedUnitInterval<f32>

Source§

type Output = f32

The resulting type after applying the + operator.
Source§

fn add(self, rhs: Self) -> Self::Output

Performs the + operation. Read more
Source§

impl Add for SignedUnitInterval<f64>

Source§

type Output = f64

The resulting type after applying the + operator.
Source§

fn add(self, rhs: Self) -> Self::Output

Performs the + operation. Read more
Source§

impl<'a> Arbitrary<'a> for SignedUnitInterval<f32>

Available on crate feature arbitrary only.
Source§

fn arbitrary(u: &mut Unstructured<'a>) -> Result<Self>

Generate an arbitrary value of Self from the given unstructured data. Read more
Source§

fn size_hint(depth: usize) -> (usize, Option<usize>)

Get a size hint for how many bytes out of an Unstructured this type needs to construct itself. Read more
Source§

fn arbitrary_take_rest(u: Unstructured<'a>) -> Result<Self, Error>

Generate an arbitrary value of Self from the entirety of the given unstructured data. Read more
Source§

fn try_size_hint( depth: usize, ) -> Result<(usize, Option<usize>), MaxRecursionReached>

Get a size hint for how many bytes out of an Unstructured this type needs to construct itself. Read more
Source§

impl<'a> Arbitrary<'a> for SignedUnitInterval<f64>

Available on crate feature arbitrary only.
Source§

fn arbitrary(u: &mut Unstructured<'a>) -> Result<Self>

Generate an arbitrary value of Self from the given unstructured data. Read more
Source§

fn size_hint(depth: usize) -> (usize, Option<usize>)

Get a size hint for how many bytes out of an Unstructured this type needs to construct itself. Read more
Source§

fn arbitrary_take_rest(u: Unstructured<'a>) -> Result<Self, Error>

Generate an arbitrary value of Self from the entirety of the given unstructured data. Read more
Source§

fn try_size_hint( depth: usize, ) -> Result<(usize, Option<usize>), MaxRecursionReached>

Get a size hint for how many bytes out of an Unstructured this type needs to construct itself. Read more
Source§

impl<T> Archive for SignedUnitInterval<T>
where T: Archive,

Source§

type Archived = ArchivedSignedUnitInterval<T>

The archived representation of this type. Read more
Source§

type Resolver = SignedUnitIntervalResolver<T>

The resolver for this type. It must contain all the additional information from serializing needed to make the archived type from the normal type.
Source§

fn resolve(&self, resolver: Self::Resolver, out: Place<Self::Archived>)

Creates the archived version of this value at the given position and writes it to the given output. Read more
Source§

const COPY_OPTIMIZATION: CopyOptimization<Self> = _

An optimization flag that allows the bytes of this type to be copied directly to a writer instead of calling serialize. Read more
Source§

impl AsPrimitive<SignedUnitInterval<f64>> for SignedUnitInterval<f32>

Available on crate feature num-traits only.
Source§

fn as_(self) -> SignedUnitInterval<f64>

Convert a value to another, using the as operator.
Source§

impl AsPrimitive<SignedUnitInterval<f64>> for SignedUnitInterval<f64>

Available on crate feature num-traits only.
Source§

fn as_(self) -> SignedUnitInterval<f64>

Convert a value to another, using the as operator.
Source§

impl AsPrimitive<SignedUnitInterval> for SignedUnitInterval<f32>

Available on crate feature num-traits only.
Source§

fn as_(self) -> SignedUnitInterval<f32>

Convert a value to another, using the as operator.
Source§

impl AsPrimitive<SignedUnitInterval> for SignedUnitInterval<f64>

Available on crate feature num-traits only.
Source§

fn as_(self) -> SignedUnitInterval<f32>

Convert a value to another, using the as operator.
Source§

impl AsPrimitive<f32> for SignedUnitInterval<f32>

Available on crate feature num-traits only.
Source§

fn as_(self) -> f32

Convert a value to another, using the as operator.
Source§

impl AsPrimitive<f32> for SignedUnitInterval<f64>

Available on crate feature num-traits only.
Source§

fn as_(self) -> f32

Convert a value to another, using the as operator.
Source§

impl AsPrimitive<f64> for SignedUnitInterval<f32>

Available on crate feature num-traits only.
Source§

fn as_(self) -> f64

Convert a value to another, using the as operator.
Source§

impl AsPrimitive<f64> for SignedUnitInterval<f64>

Available on crate feature num-traits only.
Source§

fn as_(self) -> f64

Convert a value to another, using the as operator.
Source§

impl<T> AsRef<T> for SignedUnitInterval<T>

Borrows the inner floating-point value.

Source§

fn as_ref(&self) -> &T

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl Bounded for SignedUnitInterval<f32>

Available on crate feature num-traits only.
Source§

fn min_value() -> Self

Returns the smallest finite number this type can represent
Source§

fn max_value() -> Self

Returns the largest finite number this type can represent
Source§

impl Bounded for SignedUnitInterval<f64>

Available on crate feature num-traits only.
Source§

fn min_value() -> Self

Returns the smallest finite number this type can represent
Source§

fn max_value() -> Self

Returns the largest finite number this type can represent
Source§

impl<T> CheckedBitPattern for SignedUnitInterval<T>

Available on crate feature bytemuck only.
Source§

type Bits = T

Self must have the same layout as the specified Bits except for the possible invalid bit patterns being checked during is_valid_bit_pattern.
Source§

fn is_valid_bit_pattern(bits: &Self::Bits) -> bool

If this function returns true, then it must be valid to reinterpret bits as &Self.
Source§

impl CheckedMul for SignedUnitInterval<f32>

Available on crate feature num-traits only.
Source§

fn checked_mul(&self, v: &Self) -> Option<Self>

Multiplies two numbers, checking for underflow or overflow. If underflow or overflow happens, None is returned.
Source§

impl CheckedMul for SignedUnitInterval<f64>

Available on crate feature num-traits only.
Source§

fn checked_mul(&self, v: &Self) -> Option<Self>

Multiplies two numbers, checking for underflow or overflow. If underflow or overflow happens, None is returned.
Source§

impl CheckedNeg for SignedUnitInterval<f32>

Available on crate feature num-traits only.
Source§

fn checked_neg(&self) -> Option<Self>

Negates a number, returning None for results that can’t be represented, like signed MIN values that can’t be positive, or non-zero unsigned values that can’t be negative. Read more
Source§

impl CheckedNeg for SignedUnitInterval<f64>

Available on crate feature num-traits only.
Source§

fn checked_neg(&self) -> Option<Self>

Negates a number, returning None for results that can’t be represented, like signed MIN values that can’t be positive, or non-zero unsigned values that can’t be negative. Read more
Source§

impl<T: Clone> Clone for SignedUnitInterval<T>

Source§

fn clone(&self) -> SignedUnitInterval<T>

Returns a duplicate 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 ConstOne for SignedUnitInterval<f32>

Available on crate feature num-traits only.
Source§

const ONE: Self = Self::ONE

The multiplicative identity element of Self, 1.
Source§

impl ConstOne for SignedUnitInterval<f64>

Available on crate feature num-traits only.
Source§

const ONE: Self = Self::ONE

The multiplicative identity element of Self, 1.
Source§

impl<T: Debug> Debug for SignedUnitInterval<T>

Source§

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

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

impl<T: UnitIntervalFloat> Default for SignedUnitInterval<T>

Source§

fn default() -> Self

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

impl<T> Deref for SignedUnitInterval<T>

Dereferences to the inner floating-point value.

Source§

type Target = T

The resulting type after dereferencing.
Source§

fn deref(&self) -> &Self::Target

Dereferences the value.
Source§

impl<'de, T> Deserialize<'de> for SignedUnitInterval<T>

Available on crate feature serde only.
Source§

fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>

Deserialize this value from the given Serde deserializer. Read more
Source§

impl<T, D> Distribution<SignedUnitInterval<T>> for SaturatingSignedUnitIntervalDistribution<D>

Available on crate feature rand_distr only.
Source§

fn sample<R: Rng + ?Sized>(&self, rng: &mut R) -> SignedUnitInterval<T>

Generate a random value of T, using rng as the source of randomness.
Source§

fn sample_iter<R>(self, rng: R) -> Iter<Self, R, T>
where R: Rng, Self: Sized,

Create an iterator that generates random values of T, using rng as the source of randomness. Read more
Source§

fn map<F, S>(self, func: F) -> Map<Self, F, T, S>
where F: Fn(T) -> S, Self: Sized,

Map sampled values to type S Read more
Source§

impl<T> Distribution<SignedUnitInterval<T>> for StandardUniform

Available on crate feature rand_distr only.
Source§

fn sample<R: Rng + ?Sized>(&self, rng: &mut R) -> SignedUnitInterval<T>

Generate a random value of T, using rng as the source of randomness.
Source§

fn sample_iter<R>(self, rng: R) -> Iter<Self, R, T>
where R: Rng, Self: Sized,

Create an iterator that generates random values of T, using rng as the source of randomness. Read more
Source§

fn map<F, S>(self, func: F) -> Map<Self, F, T, S>
where F: Fn(T) -> S, Self: Sized,

Map sampled values to type S Read more
Source§

impl Div<SignedUnitInterval<f64>> for UnitInterval<f64>

Source§

type Output = f64

The resulting type after applying the / operator.
Source§

fn div(self, rhs: SignedUnitInterval<f64>) -> Self::Output

Performs the / operation. Read more
Source§

impl Div<SignedUnitInterval<f64>> for f64

Source§

type Output = f64

The resulting type after applying the / operator.
Source§

fn div(self, rhs: SignedUnitInterval<f64>) -> Self::Output

Performs the / operation. Read more
Source§

impl Div<SignedUnitInterval> for UnitInterval<f32>

Source§

type Output = f32

The resulting type after applying the / operator.
Source§

fn div(self, rhs: SignedUnitInterval<f32>) -> Self::Output

Performs the / operation. Read more
Source§

impl Div<SignedUnitInterval> for f32

Source§

type Output = f32

The resulting type after applying the / operator.
Source§

fn div(self, rhs: SignedUnitInterval<f32>) -> Self::Output

Performs the / operation. Read more
Source§

impl Div<UnitInterval<f64>> for SignedUnitInterval<f64>

Source§

type Output = f64

The resulting type after applying the / operator.
Source§

fn div(self, rhs: UnitInterval<f64>) -> Self::Output

Performs the / operation. Read more
Source§

impl Div<UnitInterval> for SignedUnitInterval<f32>

Source§

type Output = f32

The resulting type after applying the / operator.
Source§

fn div(self, rhs: UnitInterval<f32>) -> Self::Output

Performs the / operation. Read more
Source§

impl Div<f32> for SignedUnitInterval<f32>

Source§

type Output = f32

The resulting type after applying the / operator.
Source§

fn div(self, rhs: f32) -> Self::Output

Performs the / operation. Read more
Source§

impl Div<f64> for SignedUnitInterval<f64>

Source§

type Output = f64

The resulting type after applying the / operator.
Source§

fn div(self, rhs: f64) -> Self::Output

Performs the / operation. Read more
Source§

impl Div for SignedUnitInterval<f32>

Source§

type Output = f32

The resulting type after applying the / operator.
Source§

fn div(self, rhs: Self) -> Self::Output

Performs the / operation. Read more
Source§

impl Div for SignedUnitInterval<f64>

Source§

type Output = f64

The resulting type after applying the / operator.
Source§

fn div(self, rhs: Self) -> Self::Output

Performs the / operation. Read more
Source§

impl From<SignedUnitInterval<f64>> for SignedUnitInterval<f32>

Converts a SignedUnitInterval<f64> into SignedUnitInterval<f32>.

Source§

fn from(u: SignedUnitInterval<f64>) -> Self

Converts to this type from the input type.
Source§

impl From<SignedUnitInterval<f64>> for f64

Source§

fn from(u: SignedUnitInterval<f64>) -> Self

Converts to this type from the input type.
Source§

impl From<SignedUnitInterval> for SignedUnitInterval<f64>

Converts a SignedUnitInterval<f32> into SignedUnitInterval<f64>.

Source§

fn from(u: SignedUnitInterval<f32>) -> Self

Converts to this type from the input type.
Source§

impl From<SignedUnitInterval> for f32

Source§

fn from(u: SignedUnitInterval<f32>) -> Self

Converts to this type from the input type.
Source§

impl From<SignedUnitInterval> for f64

Converts a SignedUnitInterval<f32> into its inner value widened to f64.

Source§

fn from(u: SignedUnitInterval) -> Self

Converts to this type from the input type.
Source§

impl<T: UnitIntervalFloat> From<UnitInterval<T>> for SignedUnitInterval<T>

Source§

fn from(u: UnitInterval<T>) -> Self

Converts to this type from the input type.
Source§

impl FromPrimitive for SignedUnitInterval<f32>

Available on crate feature num-traits only.
Source§

fn from_i64(n: i64) -> Option<Self>

Converts an i64 to return an optional value of this type. If the value cannot be represented by this type, then None is returned.
Source§

fn from_u64(n: u64) -> Option<Self>

Converts an u64 to return an optional value of this type. If the value cannot be represented by this type, then None is returned.
Source§

fn from_f32(n: f32) -> Option<Self>

Converts a f32 to return an optional value of this type. If the value cannot be represented by this type, then None is returned.
Source§

fn from_f64(n: f64) -> Option<Self>

Converts a f64 to return an optional value of this type. If the value cannot be represented by this type, then None is returned. Read more
Source§

fn from_isize(n: isize) -> Option<Self>

Converts an isize to return an optional value of this type. If the value cannot be represented by this type, then None is returned.
Source§

fn from_i8(n: i8) -> Option<Self>

Converts an i8 to return an optional value of this type. If the value cannot be represented by this type, then None is returned.
Source§

fn from_i16(n: i16) -> Option<Self>

Converts an i16 to return an optional value of this type. If the value cannot be represented by this type, then None is returned.
Source§

fn from_i32(n: i32) -> Option<Self>

Converts an i32 to return an optional value of this type. If the value cannot be represented by this type, then None is returned.
Source§

fn from_i128(n: i128) -> Option<Self>

Converts an i128 to return an optional value of this type. If the value cannot be represented by this type, then None is returned. Read more
Source§

fn from_usize(n: usize) -> Option<Self>

Converts a usize to return an optional value of this type. If the value cannot be represented by this type, then None is returned.
Source§

fn from_u8(n: u8) -> Option<Self>

Converts an u8 to return an optional value of this type. If the value cannot be represented by this type, then None is returned.
Source§

fn from_u16(n: u16) -> Option<Self>

Converts an u16 to return an optional value of this type. If the value cannot be represented by this type, then None is returned.
Source§

fn from_u32(n: u32) -> Option<Self>

Converts an u32 to return an optional value of this type. If the value cannot be represented by this type, then None is returned.
Source§

fn from_u128(n: u128) -> Option<Self>

Converts an u128 to return an optional value of this type. If the value cannot be represented by this type, then None is returned. Read more
Source§

impl FromPrimitive for SignedUnitInterval<f64>

Available on crate feature num-traits only.
Source§

fn from_i64(n: i64) -> Option<Self>

Converts an i64 to return an optional value of this type. If the value cannot be represented by this type, then None is returned.
Source§

fn from_u64(n: u64) -> Option<Self>

Converts an u64 to return an optional value of this type. If the value cannot be represented by this type, then None is returned.
Source§

fn from_f32(n: f32) -> Option<Self>

Converts a f32 to return an optional value of this type. If the value cannot be represented by this type, then None is returned.
Source§

fn from_f64(n: f64) -> Option<Self>

Converts a f64 to return an optional value of this type. If the value cannot be represented by this type, then None is returned. Read more
Source§

fn from_isize(n: isize) -> Option<Self>

Converts an isize to return an optional value of this type. If the value cannot be represented by this type, then None is returned.
Source§

fn from_i8(n: i8) -> Option<Self>

Converts an i8 to return an optional value of this type. If the value cannot be represented by this type, then None is returned.
Source§

fn from_i16(n: i16) -> Option<Self>

Converts an i16 to return an optional value of this type. If the value cannot be represented by this type, then None is returned.
Source§

fn from_i32(n: i32) -> Option<Self>

Converts an i32 to return an optional value of this type. If the value cannot be represented by this type, then None is returned.
Source§

fn from_i128(n: i128) -> Option<Self>

Converts an i128 to return an optional value of this type. If the value cannot be represented by this type, then None is returned. Read more
Source§

fn from_usize(n: usize) -> Option<Self>

Converts a usize to return an optional value of this type. If the value cannot be represented by this type, then None is returned.
Source§

fn from_u8(n: u8) -> Option<Self>

Converts an u8 to return an optional value of this type. If the value cannot be represented by this type, then None is returned.
Source§

fn from_u16(n: u16) -> Option<Self>

Converts an u16 to return an optional value of this type. If the value cannot be represented by this type, then None is returned.
Source§

fn from_u32(n: u32) -> Option<Self>

Converts an u32 to return an optional value of this type. If the value cannot be represented by this type, then None is returned.
Source§

fn from_u128(n: u128) -> Option<Self>

Converts an u128 to return an optional value of this type. If the value cannot be represented by this type, then None is returned. Read more
Source§

impl<T: UnitIntervalFloat> Mul<SignedUnitInterval<T>> for UnitInterval<T>

Multiplies a unit interval by a signed unit interval.

Source§

type Output = SignedUnitInterval<T>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: SignedUnitInterval<T>) -> Self::Output

Performs the * operation. Read more
Source§

impl Mul<SignedUnitInterval<f64>> for f64

Source§

type Output = f64

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: SignedUnitInterval<f64>) -> Self::Output

Performs the * operation. Read more
Source§

impl Mul<SignedUnitInterval> for f32

Source§

type Output = f32

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: SignedUnitInterval<f32>) -> Self::Output

Performs the * operation. Read more
Source§

impl<T: UnitIntervalFloat> Mul<UnitInterval<T>> for SignedUnitInterval<T>

Multiplies a signed unit interval by a unit interval.

Source§

type Output = SignedUnitInterval<T>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: UnitInterval<T>) -> Self::Output

Performs the * operation. Read more
Source§

impl Mul<f32> for SignedUnitInterval<f32>

Source§

type Output = f32

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: f32) -> Self::Output

Performs the * operation. Read more
Source§

impl Mul<f64> for SignedUnitInterval<f64>

Source§

type Output = f64

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: f64) -> Self::Output

Performs the * operation. Read more
Source§

impl<T: UnitIntervalFloat> Mul for SignedUnitInterval<T>

Multiplies two signed unit interval values.

Source§

type Output = SignedUnitInterval<T>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: Self) -> Self::Output

Performs the * operation. Read more
Source§

impl Neg for SignedUnitInterval<f32>

Source§

type Output = SignedUnitInterval

The resulting type after applying the - operator.
Source§

fn neg(self) -> Self::Output

Performs the unary - operation. Read more
Source§

impl Neg for SignedUnitInterval<f64>

Source§

type Output = SignedUnitInterval<f64>

The resulting type after applying the - operator.
Source§

fn neg(self) -> Self::Output

Performs the unary - operation. Read more
Source§

impl NumCast for SignedUnitInterval<f32>

Available on crate feature num-traits only.
Source§

fn from<T: ToPrimitive>(n: T) -> Option<Self>

Creates a number from another value that can be converted into a primitive via the ToPrimitive trait. If the source value cannot be represented by the target type, then None is returned. Read more
Source§

impl NumCast for SignedUnitInterval<f64>

Available on crate feature num-traits only.
Source§

fn from<T: ToPrimitive>(n: T) -> Option<Self>

Creates a number from another value that can be converted into a primitive via the ToPrimitive trait. If the source value cannot be represented by the target type, then None is returned. Read more
Source§

impl One for SignedUnitInterval<f32>

Available on crate feature num-traits only.
Source§

fn one() -> Self

Returns the multiplicative identity element of Self, 1. Read more
Source§

fn is_one(&self) -> bool

Returns true if self is equal to the multiplicative identity. Read more
Source§

fn set_one(&mut self)

Sets self to the multiplicative identity element of Self, 1.
Source§

impl One for SignedUnitInterval<f64>

Available on crate feature num-traits only.
Source§

fn one() -> Self

Returns the multiplicative identity element of Self, 1. Read more
Source§

fn is_one(&self) -> bool

Returns true if self is equal to the multiplicative identity. Read more
Source§

fn set_one(&mut self)

Sets self to the multiplicative identity element of Self, 1.
Source§

impl PartialEq<SignedUnitInterval<f64>> for f64

Source§

fn eq(&self, other: &SignedUnitInterval<f64>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialEq<SignedUnitInterval> for f32

Source§

fn eq(&self, other: &SignedUnitInterval<f32>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialEq<f32> for SignedUnitInterval<f32>

Source§

fn eq(&self, other: &f32) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialEq<f64> for SignedUnitInterval<f64>

Source§

fn eq(&self, other: &f64) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<T: PartialEq> PartialEq for SignedUnitInterval<T>

Source§

fn eq(&self, other: &SignedUnitInterval<T>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialOrd<SignedUnitInterval<f64>> for f64

Source§

fn partial_cmp(&self, other: &SignedUnitInterval<f64>) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · Source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · Source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · Source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · Source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl PartialOrd<SignedUnitInterval> for f32

Source§

fn partial_cmp(&self, other: &SignedUnitInterval<f32>) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · Source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · Source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · Source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · Source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl PartialOrd<f32> for SignedUnitInterval<f32>

Source§

fn partial_cmp(&self, other: &f32) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · Source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · Source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · Source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · Source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl PartialOrd<f64> for SignedUnitInterval<f64>

Source§

fn partial_cmp(&self, other: &f64) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · Source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · Source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · Source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · Source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl<T: PartialOrd> PartialOrd for SignedUnitInterval<T>

Source§

fn partial_cmp(&self, other: &SignedUnitInterval<T>) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · Source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · Source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · Source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · Source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl<T: UnitIntervalFloat> Pow<&u16> for &SignedUnitInterval<T>

Available on crate feature num-traits only.
Source§

type Output = SignedUnitInterval<T>

The result after applying the operator.
Source§

fn pow(self, rhs: &u16) -> Self::Output

Returns self to the power rhs. Read more
Source§

impl<T: UnitIntervalFloat> Pow<&u16> for SignedUnitInterval<T>

Available on crate feature num-traits only.
Source§

type Output = SignedUnitInterval<T>

The result after applying the operator.
Source§

fn pow(self, rhs: &u16) -> Self::Output

Returns self to the power rhs. Read more
Source§

impl<T: UnitIntervalFloat> Pow<&u32> for &SignedUnitInterval<T>

Available on crate feature num-traits only.
Source§

type Output = SignedUnitInterval<T>

The result after applying the operator.
Source§

fn pow(self, rhs: &u32) -> Self::Output

Returns self to the power rhs. Read more
Source§

impl<T: UnitIntervalFloat> Pow<&u32> for SignedUnitInterval<T>

Available on crate feature num-traits only.
Source§

type Output = SignedUnitInterval<T>

The result after applying the operator.
Source§

fn pow(self, rhs: &u32) -> Self::Output

Returns self to the power rhs. Read more
Source§

impl<T: UnitIntervalFloat> Pow<&u8> for &SignedUnitInterval<T>

Available on crate feature num-traits only.
Source§

type Output = SignedUnitInterval<T>

The result after applying the operator.
Source§

fn pow(self, rhs: &u8) -> Self::Output

Returns self to the power rhs. Read more
Source§

impl<T: UnitIntervalFloat> Pow<&u8> for SignedUnitInterval<T>

Available on crate feature num-traits only.
Source§

type Output = SignedUnitInterval<T>

The result after applying the operator.
Source§

fn pow(self, rhs: &u8) -> Self::Output

Returns self to the power rhs. Read more
Source§

impl<T: UnitIntervalFloat> Pow<&usize> for &SignedUnitInterval<T>

Available on crate feature num-traits only.
Source§

type Output = SignedUnitInterval<T>

The result after applying the operator.
Source§

fn pow(self, rhs: &usize) -> Self::Output

Returns self to the power rhs. Read more
Source§

impl<T: UnitIntervalFloat> Pow<&usize> for SignedUnitInterval<T>

Available on crate feature num-traits only.
Source§

type Output = SignedUnitInterval<T>

The result after applying the operator.
Source§

fn pow(self, rhs: &usize) -> Self::Output

Returns self to the power rhs. Read more
Source§

impl<T: UnitIntervalFloat> Pow<u16> for &SignedUnitInterval<T>

Available on crate feature num-traits only.
Source§

type Output = SignedUnitInterval<T>

The result after applying the operator.
Source§

fn pow(self, rhs: u16) -> Self::Output

Returns self to the power rhs. Read more
Source§

impl<T: UnitIntervalFloat> Pow<u16> for SignedUnitInterval<T>

Available on crate feature num-traits only.
Source§

type Output = SignedUnitInterval<T>

The result after applying the operator.
Source§

fn pow(self, rhs: u16) -> Self::Output

Returns self to the power rhs. Read more
Source§

impl<T: UnitIntervalFloat> Pow<u32> for &SignedUnitInterval<T>

Available on crate feature num-traits only.
Source§

type Output = SignedUnitInterval<T>

The result after applying the operator.
Source§

fn pow(self, rhs: u32) -> Self::Output

Returns self to the power rhs. Read more
Source§

impl<T: UnitIntervalFloat> Pow<u32> for SignedUnitInterval<T>

Available on crate feature num-traits only.
Source§

type Output = SignedUnitInterval<T>

The result after applying the operator.
Source§

fn pow(self, rhs: u32) -> Self::Output

Returns self to the power rhs. Read more
Source§

impl<T: UnitIntervalFloat> Pow<u8> for &SignedUnitInterval<T>

Available on crate feature num-traits only.
Source§

type Output = SignedUnitInterval<T>

The result after applying the operator.
Source§

fn pow(self, rhs: u8) -> Self::Output

Returns self to the power rhs. Read more
Source§

impl<T: UnitIntervalFloat> Pow<u8> for SignedUnitInterval<T>

Available on crate feature num-traits only.
Source§

type Output = SignedUnitInterval<T>

The result after applying the operator.
Source§

fn pow(self, rhs: u8) -> Self::Output

Returns self to the power rhs. Read more
Source§

impl<T: UnitIntervalFloat> Pow<usize> for &SignedUnitInterval<T>

Available on crate feature num-traits only.
Source§

type Output = SignedUnitInterval<T>

The result after applying the operator.
Source§

fn pow(self, rhs: usize) -> Self::Output

Returns self to the power rhs. Read more
Source§

impl<T: UnitIntervalFloat> Pow<usize> for SignedUnitInterval<T>

Available on crate feature num-traits only.
Source§

type Output = SignedUnitInterval<T>

The result after applying the operator.
Source§

fn pow(self, rhs: usize) -> Self::Output

Returns self to the power rhs. Read more
Source§

impl Rem<SignedUnitInterval<f64>> for UnitInterval<f64>

Source§

type Output = f64

The resulting type after applying the % operator.
Source§

fn rem(self, rhs: SignedUnitInterval<f64>) -> Self::Output

Performs the % operation. Read more
Source§

impl Rem<SignedUnitInterval<f64>> for f64

Source§

type Output = f64

The resulting type after applying the % operator.
Source§

fn rem(self, rhs: SignedUnitInterval<f64>) -> Self::Output

Performs the % operation. Read more
Source§

impl Rem<SignedUnitInterval> for UnitInterval<f32>

Source§

type Output = f32

The resulting type after applying the % operator.
Source§

fn rem(self, rhs: SignedUnitInterval<f32>) -> Self::Output

Performs the % operation. Read more
Source§

impl Rem<SignedUnitInterval> for f32

Source§

type Output = f32

The resulting type after applying the % operator.
Source§

fn rem(self, rhs: SignedUnitInterval<f32>) -> Self::Output

Performs the % operation. Read more
Source§

impl Rem<UnitInterval<f64>> for SignedUnitInterval<f64>

Source§

type Output = f64

The resulting type after applying the % operator.
Source§

fn rem(self, rhs: UnitInterval<f64>) -> Self::Output

Performs the % operation. Read more
Source§

impl Rem<UnitInterval> for SignedUnitInterval<f32>

Source§

type Output = f32

The resulting type after applying the % operator.
Source§

fn rem(self, rhs: UnitInterval<f32>) -> Self::Output

Performs the % operation. Read more
Source§

impl Rem<f32> for SignedUnitInterval<f32>

Source§

type Output = f32

The resulting type after applying the % operator.
Source§

fn rem(self, rhs: f32) -> Self::Output

Performs the % operation. Read more
Source§

impl Rem<f64> for SignedUnitInterval<f64>

Source§

type Output = f64

The resulting type after applying the % operator.
Source§

fn rem(self, rhs: f64) -> Self::Output

Performs the % operation. Read more
Source§

impl Rem for SignedUnitInterval<f32>

Source§

type Output = f32

The resulting type after applying the % operator.
Source§

fn rem(self, rhs: Self) -> Self::Output

Performs the % operation. Read more
Source§

impl Rem for SignedUnitInterval<f64>

Source§

type Output = f64

The resulting type after applying the % operator.
Source§

fn rem(self, rhs: Self) -> Self::Output

Performs the % operation. Read more
Source§

impl SaturatingMul for SignedUnitInterval<f32>

Available on crate feature num-traits only.
Source§

fn saturating_mul(&self, v: &Self) -> Self

Saturating multiplication. Computes self * other, saturating at the relevant high or low boundary of the type.
Source§

impl SaturatingMul for SignedUnitInterval<f64>

Available on crate feature num-traits only.
Source§

fn saturating_mul(&self, v: &Self) -> Self

Saturating multiplication. Computes self * other, saturating at the relevant high or low boundary of the type.
Source§

impl<__S: Fallible + ?Sized, T> Serialize<__S> for SignedUnitInterval<T>
where T: Serialize<__S>,

Source§

fn serialize( &self, serializer: &mut __S, ) -> Result<<Self as Archive>::Resolver, <__S as Fallible>::Error>

Writes the dependencies for the object and returns a resolver that can create the archived type.
Source§

impl<T: Serialize> Serialize for SignedUnitInterval<T>

Available on crate feature serde only.
Source§

fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error>

Serialize this value into the given Serde serializer. Read more
Source§

impl Sub<SignedUnitInterval<f64>> for UnitInterval<f64>

Source§

type Output = f64

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: SignedUnitInterval<f64>) -> Self::Output

Performs the - operation. Read more
Source§

impl Sub<SignedUnitInterval<f64>> for f64

Source§

type Output = f64

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: SignedUnitInterval<f64>) -> Self::Output

Performs the - operation. Read more
Source§

impl Sub<SignedUnitInterval> for UnitInterval<f32>

Source§

type Output = f32

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: SignedUnitInterval<f32>) -> Self::Output

Performs the - operation. Read more
Source§

impl Sub<SignedUnitInterval> for f32

Source§

type Output = f32

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: SignedUnitInterval<f32>) -> Self::Output

Performs the - operation. Read more
Source§

impl Sub<UnitInterval<f64>> for SignedUnitInterval<f64>

Source§

type Output = f64

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: UnitInterval<f64>) -> Self::Output

Performs the - operation. Read more
Source§

impl Sub<UnitInterval> for SignedUnitInterval<f32>

Source§

type Output = f32

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: UnitInterval<f32>) -> Self::Output

Performs the - operation. Read more
Source§

impl Sub<f32> for SignedUnitInterval<f32>

Source§

type Output = f32

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: f32) -> Self::Output

Performs the - operation. Read more
Source§

impl Sub<f64> for SignedUnitInterval<f64>

Source§

type Output = f64

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: f64) -> Self::Output

Performs the - operation. Read more
Source§

impl Sub for SignedUnitInterval<f32>

Source§

type Output = f32

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: Self) -> Self::Output

Performs the - operation. Read more
Source§

impl Sub for SignedUnitInterval<f64>

Source§

type Output = f64

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: Self) -> Self::Output

Performs the - operation. Read more
Source§

impl ToBytes for SignedUnitInterval<f32>

Available on crate feature num-traits only.
Source§

type Bytes = <f32 as ToBytes>::Bytes

Source§

fn to_be_bytes(&self) -> Self::Bytes

Return the memory representation of this number as a byte array in big-endian byte order. Read more
Source§

fn to_le_bytes(&self) -> Self::Bytes

Return the memory representation of this number as a byte array in little-endian byte order. Read more
Source§

fn to_ne_bytes(&self) -> Self::Bytes

Return the memory representation of this number as a byte array in native byte order. Read more
Source§

impl ToBytes for SignedUnitInterval<f64>

Available on crate feature num-traits only.
Source§

type Bytes = <f64 as ToBytes>::Bytes

Source§

fn to_be_bytes(&self) -> Self::Bytes

Return the memory representation of this number as a byte array in big-endian byte order. Read more
Source§

fn to_le_bytes(&self) -> Self::Bytes

Return the memory representation of this number as a byte array in little-endian byte order. Read more
Source§

fn to_ne_bytes(&self) -> Self::Bytes

Return the memory representation of this number as a byte array in native byte order. Read more
Source§

impl ToPrimitive for SignedUnitInterval<f32>

Available on crate feature num-traits only.
Source§

fn to_isize(&self) -> Option<isize>

Converts the value of self to an isize. If the value cannot be represented by an isize, then None is returned.
Source§

fn to_i8(&self) -> Option<i8>

Converts the value of self to an i8. If the value cannot be represented by an i8, then None is returned.
Source§

fn to_i16(&self) -> Option<i16>

Converts the value of self to an i16. If the value cannot be represented by an i16, then None is returned.
Source§

fn to_i32(&self) -> Option<i32>

Converts the value of self to an i32. If the value cannot be represented by an i32, then None is returned.
Source§

fn to_i64(&self) -> Option<i64>

Converts the value of self to an i64. If the value cannot be represented by an i64, then None is returned.
Source§

fn to_i128(&self) -> Option<i128>

Converts the value of self to an i128. If the value cannot be represented by an i128 (i64 under the default implementation), then None is returned. Read more
Source§

fn to_usize(&self) -> Option<usize>

Converts the value of self to a usize. If the value cannot be represented by a usize, then None is returned.
Source§

fn to_u8(&self) -> Option<u8>

Converts the value of self to a u8. If the value cannot be represented by a u8, then None is returned.
Source§

fn to_u16(&self) -> Option<u16>

Converts the value of self to a u16. If the value cannot be represented by a u16, then None is returned.
Source§

fn to_u32(&self) -> Option<u32>

Converts the value of self to a u32. If the value cannot be represented by a u32, then None is returned.
Source§

fn to_u64(&self) -> Option<u64>

Converts the value of self to a u64. If the value cannot be represented by a u64, then None is returned.
Source§

fn to_u128(&self) -> Option<u128>

Converts the value of self to a u128. If the value cannot be represented by a u128 (u64 under the default implementation), then None is returned. Read more
Source§

fn to_f32(&self) -> Option<f32>

Converts the value of self to an f32. Overflows may map to positive or negative inifinity, otherwise None is returned if the value cannot be represented by an f32.
Source§

fn to_f64(&self) -> Option<f64>

Converts the value of self to an f64. Overflows may map to positive or negative inifinity, otherwise None is returned if the value cannot be represented by an f64. Read more
Source§

impl ToPrimitive for SignedUnitInterval<f64>

Available on crate feature num-traits only.
Source§

fn to_isize(&self) -> Option<isize>

Converts the value of self to an isize. If the value cannot be represented by an isize, then None is returned.
Source§

fn to_i8(&self) -> Option<i8>

Converts the value of self to an i8. If the value cannot be represented by an i8, then None is returned.
Source§

fn to_i16(&self) -> Option<i16>

Converts the value of self to an i16. If the value cannot be represented by an i16, then None is returned.
Source§

fn to_i32(&self) -> Option<i32>

Converts the value of self to an i32. If the value cannot be represented by an i32, then None is returned.
Source§

fn to_i64(&self) -> Option<i64>

Converts the value of self to an i64. If the value cannot be represented by an i64, then None is returned.
Source§

fn to_i128(&self) -> Option<i128>

Converts the value of self to an i128. If the value cannot be represented by an i128 (i64 under the default implementation), then None is returned. Read more
Source§

fn to_usize(&self) -> Option<usize>

Converts the value of self to a usize. If the value cannot be represented by a usize, then None is returned.
Source§

fn to_u8(&self) -> Option<u8>

Converts the value of self to a u8. If the value cannot be represented by a u8, then None is returned.
Source§

fn to_u16(&self) -> Option<u16>

Converts the value of self to a u16. If the value cannot be represented by a u16, then None is returned.
Source§

fn to_u32(&self) -> Option<u32>

Converts the value of self to a u32. If the value cannot be represented by a u32, then None is returned.
Source§

fn to_u64(&self) -> Option<u64>

Converts the value of self to a u64. If the value cannot be represented by a u64, then None is returned.
Source§

fn to_u128(&self) -> Option<u128>

Converts the value of self to a u128. If the value cannot be represented by a u128 (u64 under the default implementation), then None is returned. Read more
Source§

fn to_f32(&self) -> Option<f32>

Converts the value of self to an f32. Overflows may map to positive or negative inifinity, otherwise None is returned if the value cannot be represented by an f32.
Source§

fn to_f64(&self) -> Option<f64>

Converts the value of self to an f64. Overflows may map to positive or negative inifinity, otherwise None is returned if the value cannot be represented by an f64. Read more
Source§

impl<T: UnitIntervalFloat> TryFrom<SignedUnitInterval<T>> for UnitInterval<T>

Source§

type Error = UnitIntervalError

The type returned in the event of a conversion error.
Source§

fn try_from(value: SignedUnitInterval<T>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<f32> for SignedUnitInterval<f32>

Source§

type Error = SignedUnitIntervalError

The type returned in the event of a conversion error.
Source§

fn try_from(value: f32) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<f64> for SignedUnitInterval<f64>

Source§

type Error = SignedUnitIntervalError

The type returned in the event of a conversion error.
Source§

fn try_from(value: f64) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<T> Zeroable for SignedUnitInterval<T>

Available on crate feature bytemuck only.
Source§

fn zeroed() -> Self

Source§

impl<T: Copy> Copy for SignedUnitInterval<T>

Source§

impl<T> NoUninit for SignedUnitInterval<T>

Available on crate feature bytemuck only.
Source§

impl<T> StructuralPartialEq for SignedUnitInterval<T>

Auto Trait Implementations§

§

impl<T> Freeze for SignedUnitInterval<T>
where T: Freeze,

§

impl<T> RefUnwindSafe for SignedUnitInterval<T>
where T: RefUnwindSafe,

§

impl<T> Send for SignedUnitInterval<T>
where T: Send,

§

impl<T> Sync for SignedUnitInterval<T>
where T: Sync,

§

impl<T> Unpin for SignedUnitInterval<T>
where T: Unpin,

§

impl<T> UnsafeUnpin for SignedUnitInterval<T>
where T: UnsafeUnpin,

§

impl<T> UnwindSafe for SignedUnitInterval<T>
where T: UnwindSafe,

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

Source§

type ArchivedMetadata = ()

The archived version of the pointer metadata for this type.
Source§

fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata

Converts some archived metadata to the pointer metadata for itself.
Source§

impl<T> ArchiveUnsized for T
where T: Archive,

Source§

type Archived = <T as Archive>::Archived

The archived counterpart of this type. Unlike Archive, it may be unsized. Read more
Source§

fn archived_metadata( &self, ) -> <<T as ArchiveUnsized>::Archived as ArchivePointee>::ArchivedMetadata

Creates the archived version of the metadata for this value.
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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> LayoutRaw for T

Source§

fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>

Returns the layout of the type.
Source§

impl<T> LowerBounded for T
where T: Bounded,

Source§

fn min_value() -> T

Returns the smallest finite number this type can represent
Source§

impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
where T: SharedNiching<N1, N2>, N1: Niching<T>, N2: Niching<T>,

Source§

unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool

Returns whether the given value has been niched. Read more
Source§

fn resolve_niched(out: Place<NichedOption<T, N1>>)

Writes data to out indicating that a T is niched.
Source§

impl<T> Pointee for T

Source§

type Metadata = ()

The metadata type for pointers and references to this type.
Source§

impl<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
Source§

impl<T, S> SerializeUnsized<S> for T
where T: Serialize<S>, S: Fallible + Writer + ?Sized,

Source§

fn serialize_unsized( &self, serializer: &mut S, ) -> Result<usize, <S as Fallible>::Error>

Writes the object and returns the position of the archived type.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

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 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.
Source§

impl<T> UpperBounded for T
where T: Bounded,

Source§

fn max_value() -> T

Returns the largest finite number this type can represent
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T, Rhs, Output> NumOps<Rhs, Output> for T
where T: Sub<Rhs, Output = Output> + Mul<Rhs, Output = Output> + Div<Rhs, Output = Output> + Add<Rhs, Output = Output> + Rem<Rhs, Output = Output>,