NotNan

Struct NotNan 

pub struct NotNan<T>(/* private fields */);
Expand description

A wrapper around floats providing an implementation of Eq, Ord and Hash.

A NaN value cannot be stored in this type.

use ordered_float::NotNan;

let mut v = [
    NotNan::new(2.0).unwrap(),
    NotNan::new(1.0).unwrap(),
];
v.sort();
assert_eq!(v, [1.0, 2.0]);

Because NotNan implements Ord and Eq, it can be used as a key in a HashSet, HashMap, BTreeMap, or BTreeSet (unlike the primitive f32 or f64 types):

let mut s: HashSet<NotNan<f32>> = HashSet::new();
let key = NotNan::new(1.0).unwrap();
s.insert(key);
assert!(s.contains(&key));

-0.0 and +0.0 are still considered equal. This different sign may show up in printing, or when dividing by zero (the sign of the zero becomes the sign of the resulting infinity). Therefore, NotNan may be unsuitable for use as a key in interning and memoization applications which require equal results from equal inputs, unless signed zeros make no difference or are canonicalized before insertion.

Arithmetic on NotNan values will panic if it produces a NaN value:

let a = NotNan::new(std::f32::INFINITY).unwrap();
let b = NotNan::new(std::f32::NEG_INFINITY).unwrap();

// This will panic:
let c = a + b;

§Representation

NotNan has #[repr(transparent)], so it is sound to use transmute or pointer casts to convert between any type T and NotNan<T>, as long as this does not create a NaN value. However, consider using bytemuck as a safe alternative if possible.

Implementations§

§

impl<T> NotNan<T>
where T: FloatCore,

pub fn new(val: T) -> Result<NotNan<T>, FloatIsNan>

Create a NotNan value.

Returns Err if val is NaN

§

impl<T> NotNan<T>

pub fn into_inner(self) -> T

Get the value out.

pub const unsafe fn new_unchecked(val: T) -> NotNan<T>

Create a NotNan value from a value that is guaranteed to not be NaN

§Safety

Behaviour is undefined if val is NaN

pub const unsafe fn unchecked_new(val: T) -> NotNan<T>

👎Deprecated since 2.5.0: Please use the new_unchecked function instead.

Create a NotNan value from a value that is guaranteed to not be NaN

§Safety

Behaviour is undefined if val is NaN

§

impl NotNan<f64>

pub fn as_f32(self) -> NotNan<f32>

Converts this NotNan<f64> to a NotNan<f32> while giving up on precision, using roundTiesToEven as rounding mode, yielding Infinity on overflow.

Note: For the reverse conversion (from NotNan<f32> to NotNan<f64>), you can use .into().

Trait Implementations§

§

impl<T> Add<&NotNan<T>> for NotNan<T>
where T: FloatCore,

§

type Output = NotNan<T>

The resulting type after applying the + operator.
§

fn add(self, other: &NotNan<T>) -> <NotNan<T> as Add<&NotNan<T>>>::Output

Performs the + operation. Read more
§

impl<T> Add<&T> for &NotNan<T>
where T: FloatCore,

§

type Output = NotNan<T>

The resulting type after applying the + operator.
§

fn add(self, other: &T) -> <&NotNan<T> as Add<&T>>::Output

Performs the + operation. Read more
§

impl<T> Add<&T> for NotNan<T>
where T: FloatCore,

§

type Output = NotNan<T>

The resulting type after applying the + operator.
§

fn add(self, other: &T) -> <NotNan<T> as Add<&T>>::Output

Performs the + operation. Read more
§

impl<T> Add<NotNan<T>> for &NotNan<T>
where T: FloatCore,

§

type Output = NotNan<T>

The resulting type after applying the + operator.
§

fn add(self, other: NotNan<T>) -> <&NotNan<T> as Add<NotNan<T>>>::Output

Performs the + operation. Read more
§

impl<T> Add<T> for &NotNan<T>
where T: FloatCore,

§

type Output = NotNan<T>

The resulting type after applying the + operator.
§

fn add(self, other: T) -> <&NotNan<T> as Add<T>>::Output

Performs the + operation. Read more
§

impl<T> Add<T> for NotNan<T>
where T: FloatCore,

Adds a float directly.

Panics if the provided value is NaN or the computation results in NaN

§

type Output = NotNan<T>

The resulting type after applying the + operator.
§

fn add(self, other: T) -> NotNan<T>

Performs the + operation. Read more
§

impl<T> Add for &NotNan<T>
where T: FloatCore,

§

type Output = NotNan<T>

The resulting type after applying the + operator.
§

fn add(self, other: &NotNan<T>) -> <&NotNan<T> as Add>::Output

Performs the + operation. Read more
§

impl<T> Add for NotNan<T>
where T: FloatCore,

§

type Output = NotNan<T>

The resulting type after applying the + operator.
§

fn add(self, other: NotNan<T>) -> NotNan<T>

Performs the + operation. Read more
§

impl<T> AddAssign<&NotNan<T>> for NotNan<T>
where T: FloatCore + AddAssign,

§

fn add_assign(&mut self, other: &NotNan<T>)

Performs the += operation. Read more
§

impl<T> AddAssign<&T> for NotNan<T>
where T: FloatCore + AddAssign,

§

fn add_assign(&mut self, other: &T)

Performs the += operation. Read more
§

impl<T> AddAssign<T> for NotNan<T>
where T: FloatCore + AddAssign,

§

fn add_assign(&mut self, other: T)

Performs the += operation. Read more
§

impl<T> AddAssign for NotNan<T>
where T: FloatCore + AddAssign,

§

fn add_assign(&mut self, other: NotNan<T>)

Performs the += operation. Read more
§

impl AsPrimitive<NotNan<f32>> for NotNan<f32>

§

fn as_(self) -> NotNan<f32>

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

impl AsPrimitive<NotNan<f32>> for NotNan<f64>

§

fn as_(self) -> NotNan<f32>

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

impl AsPrimitive<NotNan<f64>> for NotNan<f32>

§

fn as_(self) -> NotNan<f64>

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

impl AsPrimitive<NotNan<f64>> for NotNan<f64>

§

fn as_(self) -> NotNan<f64>

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

impl AsPrimitive<f32> for NotNan<f32>

§

fn as_(self) -> f32

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

impl AsPrimitive<f32> for NotNan<f64>

§

fn as_(self) -> f32

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

impl AsPrimitive<f64> for NotNan<f32>

§

fn as_(self) -> f64

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

impl AsPrimitive<f64> for NotNan<f64>

§

fn as_(self) -> f64

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

impl AsPrimitive<i16> for NotNan<f32>

§

fn as_(self) -> i16

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

impl AsPrimitive<i16> for NotNan<f64>

§

fn as_(self) -> i16

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

impl AsPrimitive<i32> for NotNan<f32>

§

fn as_(self) -> i32

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

impl AsPrimitive<i32> for NotNan<f64>

§

fn as_(self) -> i32

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

impl AsPrimitive<i64> for NotNan<f32>

§

fn as_(self) -> i64

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

impl AsPrimitive<i64> for NotNan<f64>

§

fn as_(self) -> i64

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

impl AsPrimitive<i8> for NotNan<f32>

§

fn as_(self) -> i8

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

impl AsPrimitive<i8> for NotNan<f64>

§

fn as_(self) -> i8

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

impl AsPrimitive<isize> for NotNan<f32>

§

fn as_(self) -> isize

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

impl AsPrimitive<isize> for NotNan<f64>

§

fn as_(self) -> isize

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

impl AsPrimitive<u16> for NotNan<f32>

§

fn as_(self) -> u16

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

impl AsPrimitive<u16> for NotNan<f64>

§

fn as_(self) -> u16

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

impl AsPrimitive<u32> for NotNan<f32>

§

fn as_(self) -> u32

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

impl AsPrimitive<u32> for NotNan<f64>

§

fn as_(self) -> u32

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

impl AsPrimitive<u64> for NotNan<f32>

§

fn as_(self) -> u64

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

impl AsPrimitive<u64> for NotNan<f64>

§

fn as_(self) -> u64

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

impl AsPrimitive<u8> for NotNan<f32>

§

fn as_(self) -> u8

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

impl AsPrimitive<u8> for NotNan<f64>

§

fn as_(self) -> u8

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

impl AsPrimitive<usize> for NotNan<f32>

§

fn as_(self) -> usize

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

impl AsPrimitive<usize> for NotNan<f64>

§

fn as_(self) -> usize

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

impl<T> AsRef<T> for NotNan<T>
where T: FloatCore,

§

fn as_ref(&self) -> &T

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

impl Borrow<f32> for NotNan<f32>

§

fn borrow(&self) -> &f32

Immutably borrows from an owned value. Read more
§

impl Borrow<f64> for NotNan<f64>

§

fn borrow(&self) -> &f64

Immutably borrows from an owned value. Read more
§

impl<T> Bounded for NotNan<T>
where T: FloatCore,

§

fn min_value() -> NotNan<T>

Returns the smallest finite number this type can represent
§

fn max_value() -> NotNan<T>

Returns the largest finite number this type can represent
§

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

§

fn clone(&self) -> NotNan<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
§

impl<T> Debug for NotNan<T>
where T: Debug,

§

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

Formats the value using the given formatter. Read more
§

impl<T> Default for NotNan<T>
where T: Default,

§

fn default() -> NotNan<T>

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

impl<T> Deref for NotNan<T>
where T: FloatCore,

§

type Target = T

The resulting type after dereferencing.
§

fn deref(&self) -> &<NotNan<T> as Deref>::Target

Dereferences the value.
§

impl<T> Display for NotNan<T>
where T: FloatCore + Display,

§

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

Formats the value using the given formatter. Read more
§

impl<T> Div<&NotNan<T>> for NotNan<T>
where T: FloatCore,

§

type Output = NotNan<T>

The resulting type after applying the / operator.
§

fn div(self, other: &NotNan<T>) -> <NotNan<T> as Div<&NotNan<T>>>::Output

Performs the / operation. Read more
§

impl<T> Div<&T> for &NotNan<T>
where T: FloatCore,

§

type Output = NotNan<T>

The resulting type after applying the / operator.
§

fn div(self, other: &T) -> <&NotNan<T> as Div<&T>>::Output

Performs the / operation. Read more
§

impl<T> Div<&T> for NotNan<T>
where T: FloatCore,

§

type Output = NotNan<T>

The resulting type after applying the / operator.
§

fn div(self, other: &T) -> <NotNan<T> as Div<&T>>::Output

Performs the / operation. Read more
§

impl<T> Div<NotNan<T>> for &NotNan<T>
where T: FloatCore,

§

type Output = NotNan<T>

The resulting type after applying the / operator.
§

fn div(self, other: NotNan<T>) -> <&NotNan<T> as Div<NotNan<T>>>::Output

Performs the / operation. Read more
§

impl<T> Div<T> for &NotNan<T>
where T: FloatCore,

§

type Output = NotNan<T>

The resulting type after applying the / operator.
§

fn div(self, other: T) -> <&NotNan<T> as Div<T>>::Output

Performs the / operation. Read more
§

impl<T> Div<T> for NotNan<T>
where T: FloatCore,

Divides a float directly.

Panics if the provided value is NaN or the computation results in NaN

§

type Output = NotNan<T>

The resulting type after applying the / operator.
§

fn div(self, other: T) -> NotNan<T>

Performs the / operation. Read more
§

impl<T> Div for &NotNan<T>
where T: FloatCore,

§

type Output = NotNan<T>

The resulting type after applying the / operator.
§

fn div(self, other: &NotNan<T>) -> <&NotNan<T> as Div>::Output

Performs the / operation. Read more
§

impl<T> Div for NotNan<T>
where T: FloatCore,

§

type Output = NotNan<T>

The resulting type after applying the / operator.
§

fn div(self, other: NotNan<T>) -> NotNan<T>

Performs the / operation. Read more
§

impl<T> DivAssign<&NotNan<T>> for NotNan<T>
where T: FloatCore + DivAssign,

§

fn div_assign(&mut self, other: &NotNan<T>)

Performs the /= operation. Read more
§

impl<T> DivAssign<&T> for NotNan<T>
where T: FloatCore + DivAssign,

§

fn div_assign(&mut self, other: &T)

Performs the /= operation. Read more
§

impl<T> DivAssign<T> for NotNan<T>
where T: FloatCore + DivAssign,

§

fn div_assign(&mut self, other: T)

Performs the /= operation. Read more
§

impl<T> DivAssign for NotNan<T>
where T: FloatCore + DivAssign,

§

fn div_assign(&mut self, other: NotNan<T>)

Performs the /= operation. Read more
§

impl<T> FloatConst for NotNan<T>
where T: FloatConst,

§

fn E() -> NotNan<T>

Return Euler’s number.
§

fn FRAC_1_PI() -> NotNan<T>

Return 1.0 / π.
§

fn FRAC_1_SQRT_2() -> NotNan<T>

Return 1.0 / sqrt(2.0).
§

fn FRAC_2_PI() -> NotNan<T>

Return 2.0 / π.
§

fn FRAC_2_SQRT_PI() -> NotNan<T>

Return 2.0 / sqrt(π).
§

fn FRAC_PI_2() -> NotNan<T>

Return π / 2.0.
§

fn FRAC_PI_3() -> NotNan<T>

Return π / 3.0.
§

fn FRAC_PI_4() -> NotNan<T>

Return π / 4.0.
§

fn FRAC_PI_6() -> NotNan<T>

Return π / 6.0.
§

fn FRAC_PI_8() -> NotNan<T>

Return π / 8.0.
§

fn LN_10() -> NotNan<T>

Return ln(10.0).
§

fn LN_2() -> NotNan<T>

Return ln(2.0).
§

fn LOG10_E() -> NotNan<T>

Return log10(e).
§

fn LOG2_E() -> NotNan<T>

Return log2(e).
§

fn PI() -> NotNan<T>

Return Archimedes’ constant π.
§

fn SQRT_2() -> NotNan<T>

Return sqrt(2.0).
Source§

fn TAU() -> Self
where Self: Sized + Add<Output = Self>,

Return the full circle constant τ.
Source§

fn LOG10_2() -> Self
where Self: Sized + Div<Output = Self>,

Return log10(2.0).
Source§

fn LOG2_10() -> Self
where Self: Sized + Div<Output = Self>,

Return log2(10.0).
§

impl From<NotNan<f32>> for NotNan<f64>

§

fn from(v: NotNan<f32>) -> NotNan<f64>

Converts to this type from the input type.
Source§

impl From<NotNan<f32>> for Value

Source§

fn from(value: NotNan<f32>) -> Self

Converts to this type from the input type.
Source§

impl From<NotNan<f64>> for Literal

Source§

fn from(v: NotNan<f64>) -> Self

Converts to this type from the input type.
Source§

impl From<NotNan<f64>> for Value

Source§

fn from(value: NotNan<f64>) -> Self

Converts to this type from the input type.
§

impl From<i16> for NotNan<f32>

§

fn from(source: i16) -> NotNan<f32>

Converts to this type from the input type.
§

impl From<i16> for NotNan<f64>

§

fn from(source: i16) -> NotNan<f64>

Converts to this type from the input type.
§

impl From<i32> for NotNan<f64>

§

fn from(source: i32) -> NotNan<f64>

Converts to this type from the input type.
§

impl From<i8> for NotNan<f32>

§

fn from(source: i8) -> NotNan<f32>

Converts to this type from the input type.
§

impl From<i8> for NotNan<f64>

§

fn from(source: i8) -> NotNan<f64>

Converts to this type from the input type.
§

impl From<u16> for NotNan<f32>

§

fn from(source: u16) -> NotNan<f32>

Converts to this type from the input type.
§

impl From<u16> for NotNan<f64>

§

fn from(source: u16) -> NotNan<f64>

Converts to this type from the input type.
§

impl From<u32> for NotNan<f64>

§

fn from(source: u32) -> NotNan<f64>

Converts to this type from the input type.
§

impl From<u8> for NotNan<f32>

§

fn from(source: u8) -> NotNan<f32>

Converts to this type from the input type.
§

impl From<u8> for NotNan<f64>

§

fn from(source: u8) -> NotNan<f64>

Converts to this type from the input type.
§

impl<T> FromPrimitive for NotNan<T>

§

fn from_i64(n: i64) -> Option<NotNan<T>>

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

fn from_u64(n: u64) -> Option<NotNan<T>>

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

fn from_isize(n: isize) -> Option<NotNan<T>>

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

fn from_i8(n: i8) -> Option<NotNan<T>>

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

fn from_i16(n: i16) -> Option<NotNan<T>>

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

fn from_i32(n: i32) -> Option<NotNan<T>>

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

fn from_usize(n: usize) -> Option<NotNan<T>>

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

fn from_u8(n: u8) -> Option<NotNan<T>>

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

fn from_u16(n: u16) -> Option<NotNan<T>>

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

fn from_u32(n: u32) -> Option<NotNan<T>>

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

fn from_f32(n: f32) -> Option<NotNan<T>>

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

fn from_f64(n: f64) -> Option<NotNan<T>>

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_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_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
§

impl<T> FromStr for NotNan<T>
where T: FloatCore + FromStr,

§

fn from_str(src: &str) -> Result<NotNan<T>, <NotNan<T> as FromStr>::Err>

Convert a &str to NotNan. Returns an error if the string fails to parse, or if the resulting value is NaN

use ordered_float::NotNan;

assert!("-10".parse::<NotNan<f32>>().is_ok());
assert!("abc".parse::<NotNan<f32>>().is_err());
assert!("NaN".parse::<NotNan<f32>>().is_err());
§

type Err = ParseNotNanError<<T as FromStr>::Err>

The associated error which can be returned from parsing.
§

impl<T> Hash for NotNan<T>
where T: FloatCore,

§

fn hash<H>(&self, state: &mut H)
where H: Hasher,

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
§

impl<T> Mul<&NotNan<T>> for NotNan<T>
where T: FloatCore,

§

type Output = NotNan<T>

The resulting type after applying the * operator.
§

fn mul(self, other: &NotNan<T>) -> <NotNan<T> as Mul<&NotNan<T>>>::Output

Performs the * operation. Read more
§

impl<T> Mul<&T> for &NotNan<T>
where T: FloatCore,

§

type Output = NotNan<T>

The resulting type after applying the * operator.
§

fn mul(self, other: &T) -> <&NotNan<T> as Mul<&T>>::Output

Performs the * operation. Read more
§

impl<T> Mul<&T> for NotNan<T>
where T: FloatCore,

§

type Output = NotNan<T>

The resulting type after applying the * operator.
§

fn mul(self, other: &T) -> <NotNan<T> as Mul<&T>>::Output

Performs the * operation. Read more
§

impl<T> Mul<NotNan<T>> for &NotNan<T>
where T: FloatCore,

§

type Output = NotNan<T>

The resulting type after applying the * operator.
§

fn mul(self, other: NotNan<T>) -> <&NotNan<T> as Mul<NotNan<T>>>::Output

Performs the * operation. Read more
§

impl<T> Mul<T> for &NotNan<T>
where T: FloatCore,

§

type Output = NotNan<T>

The resulting type after applying the * operator.
§

fn mul(self, other: T) -> <&NotNan<T> as Mul<T>>::Output

Performs the * operation. Read more
§

impl<T> Mul<T> for NotNan<T>
where T: FloatCore,

Multiplies a float directly.

Panics if the provided value is NaN or the computation results in NaN

§

type Output = NotNan<T>

The resulting type after applying the * operator.
§

fn mul(self, other: T) -> NotNan<T>

Performs the * operation. Read more
§

impl<T> Mul for &NotNan<T>
where T: FloatCore,

§

type Output = NotNan<T>

The resulting type after applying the * operator.
§

fn mul(self, other: &NotNan<T>) -> <&NotNan<T> as Mul>::Output

Performs the * operation. Read more
§

impl<T> Mul for NotNan<T>
where T: FloatCore,

§

type Output = NotNan<T>

The resulting type after applying the * operator.
§

fn mul(self, other: NotNan<T>) -> NotNan<T>

Performs the * operation. Read more
§

impl<T> MulAssign<&NotNan<T>> for NotNan<T>
where T: FloatCore + MulAssign,

§

fn mul_assign(&mut self, other: &NotNan<T>)

Performs the *= operation. Read more
§

impl<T> MulAssign<&T> for NotNan<T>
where T: FloatCore + MulAssign,

§

fn mul_assign(&mut self, other: &T)

Performs the *= operation. Read more
§

impl<T> MulAssign<T> for NotNan<T>
where T: FloatCore + MulAssign,

§

fn mul_assign(&mut self, other: T)

Performs the *= operation. Read more
§

impl<T> MulAssign for NotNan<T>
where T: FloatCore + MulAssign,

§

fn mul_assign(&mut self, other: NotNan<T>)

Performs the *= operation. Read more
§

impl<T> Neg for &NotNan<T>
where T: FloatCore,

§

type Output = NotNan<T>

The resulting type after applying the - operator.
§

fn neg(self) -> <&NotNan<T> as Neg>::Output

Performs the unary - operation. Read more
§

impl<T> Neg for NotNan<T>
where T: FloatCore,

§

type Output = NotNan<T>

The resulting type after applying the - operator.
§

fn neg(self) -> NotNan<T>

Performs the unary - operation. Read more
§

impl<T> Num for NotNan<T>
where T: FloatCore,

§

type FromStrRadixErr = ParseNotNanError<<T as Num>::FromStrRadixErr>

§

fn from_str_radix( src: &str, radix: u32, ) -> Result<NotNan<T>, <NotNan<T> as Num>::FromStrRadixErr>

Convert from a string and radix (typically 2..=36). Read more
§

impl<T> NumCast for NotNan<T>
where T: FloatCore,

§

fn from<F>(n: F) -> Option<NotNan<T>>
where F: ToPrimitive,

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
§

impl<T> One for NotNan<T>
where T: FloatCore,

§

fn one() -> NotNan<T>

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

fn set_one(&mut self)

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

fn is_one(&self) -> bool
where Self: PartialEq,

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

impl<T> Ord for NotNan<T>
where T: FloatCore,

§

fn cmp(&self, other: &NotNan<T>) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · Source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · Source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · Source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized,

Restrict a value to a certain interval. Read more
§

impl<T> PartialEq<T> for NotNan<T>
where T: FloatCore,

§

fn eq(&self, other: &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.
§

impl<T> PartialEq for NotNan<T>
where T: PartialEq,

§

fn eq(&self, other: &NotNan<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.
§

impl<T> PartialOrd for NotNan<T>
where T: PartialOrd,

§

fn partial_cmp(&self, other: &NotNan<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
§

impl<'a, T> Product<&'a NotNan<T>> for NotNan<T>
where T: FloatCore + Product + 'a,

§

fn product<I>(iter: I) -> NotNan<T>
where I: Iterator<Item = &'a NotNan<T>>,

Takes an iterator and generates Self from the elements by multiplying the items.
§

impl<T> Product for NotNan<T>
where T: FloatCore + Product,

§

fn product<I>(iter: I) -> NotNan<T>
where I: Iterator<Item = NotNan<T>>,

Takes an iterator and generates Self from the elements by multiplying the items.
§

impl<T> Rem<&NotNan<T>> for NotNan<T>
where T: FloatCore,

§

type Output = NotNan<T>

The resulting type after applying the % operator.
§

fn rem(self, other: &NotNan<T>) -> <NotNan<T> as Rem<&NotNan<T>>>::Output

Performs the % operation. Read more
§

impl<T> Rem<&T> for &NotNan<T>
where T: FloatCore,

§

type Output = NotNan<T>

The resulting type after applying the % operator.
§

fn rem(self, other: &T) -> <&NotNan<T> as Rem<&T>>::Output

Performs the % operation. Read more
§

impl<T> Rem<&T> for NotNan<T>
where T: FloatCore,

§

type Output = NotNan<T>

The resulting type after applying the % operator.
§

fn rem(self, other: &T) -> <NotNan<T> as Rem<&T>>::Output

Performs the % operation. Read more
§

impl<T> Rem<NotNan<T>> for &NotNan<T>
where T: FloatCore,

§

type Output = NotNan<T>

The resulting type after applying the % operator.
§

fn rem(self, other: NotNan<T>) -> <&NotNan<T> as Rem<NotNan<T>>>::Output

Performs the % operation. Read more
§

impl<T> Rem<T> for &NotNan<T>
where T: FloatCore,

§

type Output = NotNan<T>

The resulting type after applying the % operator.
§

fn rem(self, other: T) -> <&NotNan<T> as Rem<T>>::Output

Performs the % operation. Read more
§

impl<T> Rem<T> for NotNan<T>
where T: FloatCore,

Calculates % with a float directly.

Panics if the provided value is NaN or the computation results in NaN

§

type Output = NotNan<T>

The resulting type after applying the % operator.
§

fn rem(self, other: T) -> NotNan<T>

Performs the % operation. Read more
§

impl<T> Rem for &NotNan<T>
where T: FloatCore,

§

type Output = NotNan<T>

The resulting type after applying the % operator.
§

fn rem(self, other: &NotNan<T>) -> <&NotNan<T> as Rem>::Output

Performs the % operation. Read more
§

impl<T> Rem for NotNan<T>
where T: FloatCore,

§

type Output = NotNan<T>

The resulting type after applying the % operator.
§

fn rem(self, other: NotNan<T>) -> NotNan<T>

Performs the % operation. Read more
§

impl<T> RemAssign<&NotNan<T>> for NotNan<T>
where T: FloatCore + RemAssign,

§

fn rem_assign(&mut self, other: &NotNan<T>)

Performs the %= operation. Read more
§

impl<T> RemAssign<&T> for NotNan<T>
where T: FloatCore + RemAssign,

§

fn rem_assign(&mut self, other: &T)

Performs the %= operation. Read more
§

impl<T> RemAssign<T> for NotNan<T>
where T: FloatCore + RemAssign,

§

fn rem_assign(&mut self, other: T)

Performs the %= operation. Read more
§

impl<T> RemAssign for NotNan<T>
where T: FloatCore + RemAssign,

§

fn rem_assign(&mut self, other: NotNan<T>)

Performs the %= operation. Read more
§

impl<T> Signed for NotNan<T>
where T: FloatCore + Signed,

§

fn abs(&self) -> NotNan<T>

Computes the absolute value. Read more
§

fn abs_sub(&self, other: &NotNan<T>) -> NotNan<T>

The positive difference of two numbers. Read more
§

fn signum(&self) -> NotNan<T>

Returns the sign of the number. Read more
§

fn is_positive(&self) -> bool

Returns true if the number is positive and false if the number is zero or negative.
§

fn is_negative(&self) -> bool

Returns true if the number is negative and false if the number is zero or positive.
§

impl<T> Sub<&NotNan<T>> for NotNan<T>
where T: FloatCore,

§

type Output = NotNan<T>

The resulting type after applying the - operator.
§

fn sub(self, other: &NotNan<T>) -> <NotNan<T> as Sub<&NotNan<T>>>::Output

Performs the - operation. Read more
§

impl<T> Sub<&T> for &NotNan<T>
where T: FloatCore,

§

type Output = NotNan<T>

The resulting type after applying the - operator.
§

fn sub(self, other: &T) -> <&NotNan<T> as Sub<&T>>::Output

Performs the - operation. Read more
§

impl<T> Sub<&T> for NotNan<T>
where T: FloatCore,

§

type Output = NotNan<T>

The resulting type after applying the - operator.
§

fn sub(self, other: &T) -> <NotNan<T> as Sub<&T>>::Output

Performs the - operation. Read more
§

impl<T> Sub<NotNan<T>> for &NotNan<T>
where T: FloatCore,

§

type Output = NotNan<T>

The resulting type after applying the - operator.
§

fn sub(self, other: NotNan<T>) -> <&NotNan<T> as Sub<NotNan<T>>>::Output

Performs the - operation. Read more
§

impl<T> Sub<T> for &NotNan<T>
where T: FloatCore,

§

type Output = NotNan<T>

The resulting type after applying the - operator.
§

fn sub(self, other: T) -> <&NotNan<T> as Sub<T>>::Output

Performs the - operation. Read more
§

impl<T> Sub<T> for NotNan<T>
where T: FloatCore,

Subtracts a float directly.

Panics if the provided value is NaN or the computation results in NaN

§

type Output = NotNan<T>

The resulting type after applying the - operator.
§

fn sub(self, other: T) -> NotNan<T>

Performs the - operation. Read more
§

impl<T> Sub for &NotNan<T>
where T: FloatCore,

§

type Output = NotNan<T>

The resulting type after applying the - operator.
§

fn sub(self, other: &NotNan<T>) -> <&NotNan<T> as Sub>::Output

Performs the - operation. Read more
§

impl<T> Sub for NotNan<T>
where T: FloatCore,

§

type Output = NotNan<T>

The resulting type after applying the - operator.
§

fn sub(self, other: NotNan<T>) -> NotNan<T>

Performs the - operation. Read more
§

impl<T> SubAssign<&NotNan<T>> for NotNan<T>
where T: FloatCore + SubAssign,

§

fn sub_assign(&mut self, other: &NotNan<T>)

Performs the -= operation. Read more
§

impl<T> SubAssign<&T> for NotNan<T>
where T: FloatCore + SubAssign,

§

fn sub_assign(&mut self, other: &T)

Performs the -= operation. Read more
§

impl<T> SubAssign<T> for NotNan<T>
where T: FloatCore + SubAssign,

§

fn sub_assign(&mut self, other: T)

Performs the -= operation. Read more
§

impl<T> SubAssign for NotNan<T>
where T: FloatCore + SubAssign,

§

fn sub_assign(&mut self, other: NotNan<T>)

Performs the -= operation. Read more
§

impl<'a, T> Sum<&'a NotNan<T>> for NotNan<T>
where T: FloatCore + Sum + 'a,

§

fn sum<I>(iter: I) -> NotNan<T>
where I: Iterator<Item = &'a NotNan<T>>,

Takes an iterator and generates Self from the elements by “summing up” the items.
§

impl<T> Sum for NotNan<T>
where T: FloatCore + Sum,

Adds a float directly.

Panics if the provided value is NaN.

§

fn sum<I>(iter: I) -> NotNan<T>
where I: Iterator<Item = NotNan<T>>,

Takes an iterator and generates Self from the elements by “summing up” the items.
§

impl<T> ToPrimitive for NotNan<T>
where T: FloatCore,

§

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

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

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

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

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

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

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

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

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

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

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

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§

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_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
§

impl TryFrom<f32> for NotNan<f32>

§

type Error = FloatIsNan

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

fn try_from(v: f32) -> Result<NotNan<f32>, <NotNan<f32> as TryFrom<f32>>::Error>

Performs the conversion.
§

impl TryFrom<f64> for NotNan<f64>

§

type Error = FloatIsNan

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

fn try_from(v: f64) -> Result<NotNan<f64>, <NotNan<f64> as TryFrom<f64>>::Error>

Performs the conversion.
§

impl<T> Zero for NotNan<T>
where T: FloatCore,

§

fn zero() -> NotNan<T>

Returns the additive identity element of Self, 0. Read more
§

fn is_zero(&self) -> bool

Returns true if self is equal to the additive identity.
Source§

fn set_zero(&mut self)

Sets self to the additive identity element of Self, 0.
§

impl<T> Copy for NotNan<T>
where T: Copy,

§

impl<T> Eq for NotNan<T>
where T: FloatCore + PartialEq,

§

impl<T> StructuralPartialEq for NotNan<T>

Auto Trait Implementations§

§

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

§

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

§

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

§

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

§

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

§

impl<T> UnwindSafe for NotNan<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
§

impl<T> AsOut<T> for T
where T: Copy,

§

fn as_out(&mut self) -> Out<'_, T>

Returns an out reference to self.
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
§

impl<Q, K> Comparable<K> for Q
where Q: Ord + ?Sized, K: Borrow<Q> + ?Sized,

§

fn compare(&self, key: &K) -> Ordering

Compare self to key and return their ordering.
Source§

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

Source§

fn __clone_box(&self, _: Private) -> *mut ()

§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> LowerBounded for T
where T: Bounded,

Source§

fn min_value() -> T

Returns the smallest finite number this type can represent
§

impl<Source, Target> OctetsInto<Target> for Source
where Target: OctetsFrom<Source>,

§

type Error = <Target as OctetsFrom<Source>>::Error

§

fn try_octets_into( self, ) -> Result<Target, <Source as OctetsInto<Target>>::Error>

Performs the conversion.
§

fn octets_into(self) -> Target
where Self::Error: Into<Infallible>,

Performs an infallible conversion.
§

impl<D> OwoColorize for D

§

fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>
where C: Color,

Set the foreground color generically Read more
§

fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>
where C: Color,

Set the background color generically. Read more
§

fn black(&self) -> FgColorDisplay<'_, Black, Self>

Change the foreground color to black
§

fn on_black(&self) -> BgColorDisplay<'_, Black, Self>

Change the background color to black
§

fn red(&self) -> FgColorDisplay<'_, Red, Self>

Change the foreground color to red
§

fn on_red(&self) -> BgColorDisplay<'_, Red, Self>

Change the background color to red
§

fn green(&self) -> FgColorDisplay<'_, Green, Self>

Change the foreground color to green
§

fn on_green(&self) -> BgColorDisplay<'_, Green, Self>

Change the background color to green
§

fn yellow(&self) -> FgColorDisplay<'_, Yellow, Self>

Change the foreground color to yellow
§

fn on_yellow(&self) -> BgColorDisplay<'_, Yellow, Self>

Change the background color to yellow
§

fn blue(&self) -> FgColorDisplay<'_, Blue, Self>

Change the foreground color to blue
§

fn on_blue(&self) -> BgColorDisplay<'_, Blue, Self>

Change the background color to blue
§

fn magenta(&self) -> FgColorDisplay<'_, Magenta, Self>

Change the foreground color to magenta
§

fn on_magenta(&self) -> BgColorDisplay<'_, Magenta, Self>

Change the background color to magenta
§

fn purple(&self) -> FgColorDisplay<'_, Magenta, Self>

Change the foreground color to purple
§

fn on_purple(&self) -> BgColorDisplay<'_, Magenta, Self>

Change the background color to purple
§

fn cyan(&self) -> FgColorDisplay<'_, Cyan, Self>

Change the foreground color to cyan
§

fn on_cyan(&self) -> BgColorDisplay<'_, Cyan, Self>

Change the background color to cyan
§

fn white(&self) -> FgColorDisplay<'_, White, Self>

Change the foreground color to white
§

fn on_white(&self) -> BgColorDisplay<'_, White, Self>

Change the background color to white
§

fn default_color(&self) -> FgColorDisplay<'_, Default, Self>

Change the foreground color to the terminal default
§

fn on_default_color(&self) -> BgColorDisplay<'_, Default, Self>

Change the background color to the terminal default
§

fn bright_black(&self) -> FgColorDisplay<'_, BrightBlack, Self>

Change the foreground color to bright black
§

fn on_bright_black(&self) -> BgColorDisplay<'_, BrightBlack, Self>

Change the background color to bright black
§

fn bright_red(&self) -> FgColorDisplay<'_, BrightRed, Self>

Change the foreground color to bright red
§

fn on_bright_red(&self) -> BgColorDisplay<'_, BrightRed, Self>

Change the background color to bright red
§

fn bright_green(&self) -> FgColorDisplay<'_, BrightGreen, Self>

Change the foreground color to bright green
§

fn on_bright_green(&self) -> BgColorDisplay<'_, BrightGreen, Self>

Change the background color to bright green
§

fn bright_yellow(&self) -> FgColorDisplay<'_, BrightYellow, Self>

Change the foreground color to bright yellow
§

fn on_bright_yellow(&self) -> BgColorDisplay<'_, BrightYellow, Self>

Change the background color to bright yellow
§

fn bright_blue(&self) -> FgColorDisplay<'_, BrightBlue, Self>

Change the foreground color to bright blue
§

fn on_bright_blue(&self) -> BgColorDisplay<'_, BrightBlue, Self>

Change the background color to bright blue
§

fn bright_magenta(&self) -> FgColorDisplay<'_, BrightMagenta, Self>

Change the foreground color to bright magenta
§

fn on_bright_magenta(&self) -> BgColorDisplay<'_, BrightMagenta, Self>

Change the background color to bright magenta
§

fn bright_purple(&self) -> FgColorDisplay<'_, BrightMagenta, Self>

Change the foreground color to bright purple
§

fn on_bright_purple(&self) -> BgColorDisplay<'_, BrightMagenta, Self>

Change the background color to bright purple
§

fn bright_cyan(&self) -> FgColorDisplay<'_, BrightCyan, Self>

Change the foreground color to bright cyan
§

fn on_bright_cyan(&self) -> BgColorDisplay<'_, BrightCyan, Self>

Change the background color to bright cyan
§

fn bright_white(&self) -> FgColorDisplay<'_, BrightWhite, Self>

Change the foreground color to bright white
§

fn on_bright_white(&self) -> BgColorDisplay<'_, BrightWhite, Self>

Change the background color to bright white
§

fn bold(&self) -> BoldDisplay<'_, Self>

Make the text bold
§

fn dimmed(&self) -> DimDisplay<'_, Self>

Make the text dim
§

fn italic(&self) -> ItalicDisplay<'_, Self>

Make the text italicized
§

fn underline(&self) -> UnderlineDisplay<'_, Self>

Make the text underlined
Make the text blink
Make the text blink (but fast!)
§

fn reversed(&self) -> ReversedDisplay<'_, Self>

Swap the foreground and background colors
§

fn hidden(&self) -> HiddenDisplay<'_, Self>

Hide the text
§

fn strikethrough(&self) -> StrikeThroughDisplay<'_, Self>

Cross out the text
§

fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>
where Color: DynColor,

Set the foreground color at runtime. Only use if you do not know which color will be used at compile-time. If the color is constant, use either [OwoColorize::fg] or a color-specific method, such as [OwoColorize::green], Read more
§

fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>
where Color: DynColor,

Set the background color at runtime. Only use if you do not know what color to use at compile-time. If the color is constant, use either [OwoColorize::bg] or a color-specific method, such as [OwoColorize::on_yellow], Read more
§

fn fg_rgb<const R: u8, const G: u8, const B: u8>( &self, ) -> FgColorDisplay<'_, CustomColor<R, G, B>, Self>

Set the foreground color to a specific RGB value.
§

fn bg_rgb<const R: u8, const G: u8, const B: u8>( &self, ) -> BgColorDisplay<'_, CustomColor<R, G, B>, Self>

Set the background color to a specific RGB value.
§

fn truecolor(&self, r: u8, g: u8, b: u8) -> FgDynColorDisplay<'_, Rgb, Self>

Sets the foreground color to an RGB value.
§

fn on_truecolor(&self, r: u8, g: u8, b: u8) -> BgDynColorDisplay<'_, Rgb, Self>

Sets the background color to an RGB value.
§

fn style(&self, style: Style) -> Styled<&Self>

Apply a runtime-determined style
§

fn if_supports_color<'a, Out, ApplyFn>( &'a self, stream: impl Into<Stream>, apply: ApplyFn, ) -> SupportsColorsDisplay<'a, Self, Out, ApplyFn>
where ApplyFn: Fn(&'a Self) -> Out,

Apply a given transformation function to all formatters if the given stream supports at least basic ANSI colors, allowing you to conditionally apply given styles/colors. Read more
§

impl<T> PolicyExt for T
where T: ?Sized,

§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] only if self and other return Action::Follow. Read more
§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] if either self or other returns Action::Follow. Read more
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> Same for T

Source§

type Output = T

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

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
§

impl<T> ToStringFallible for T
where T: Display,

§

fn try_to_string(&self) -> Result<String, TryReserveError>

ToString::to_string, but without panic on OOM.

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
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

impl<T> ErasedDestructor for T
where T: 'static,

§

impl<T> Formattable for T
where T: Deref, <T as Deref>::Target: Formattable,

§

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

§

impl<T> MaybeSendSync for T

Source§

impl<T> NumAssign for T
where T: Num + NumAssignOps,

Source§

impl<T, Rhs> NumAssignOps<Rhs> for T
where T: AddAssign<Rhs> + SubAssign<Rhs> + MulAssign<Rhs> + DivAssign<Rhs> + RemAssign<Rhs>,

Source§

impl<T> NumAssignRef for T
where T: NumAssign + for<'r> NumAssignOps<&'r T>,

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

Source§

impl<T> NumRef for T
where T: Num + for<'r> NumOps<&'r T>,

§

impl<T> Parsable for T
where T: Deref, <T as Deref>::Target: Parsable,

Source§

impl<T, Base> RefNum<Base> for T
where T: NumOps<Base, Base> + for<'r> NumOps<&'r Base, Base>,

Source§

impl<T> RuleType for T
where T: Copy + Debug + Eq + Hash + Ord,