Trait xias::Xias [−][src]
pub trait Xias {
fn homosign<T>(self) -> T
where
Self: Homosign<T>,
{ ... }
fn lossy_float<T>(self) -> T
where
Self: LossyFloat<T>,
{ ... }
fn small_int<T>(self) -> T
where
Self: SmallInt<T>,
{ ... }
fn small_float<T>(self) -> T
where
Self: SmallFloat<T>,
{ ... }
fn trunc_int<T>(self) -> T
where
Self: TruncInt<T>,
{ ... }
}
Expand description
Blanket trait that imports all traits in this crate.
Improves syntax ergonomics by allowing the syntax foo.bar::<T>()
.
Provided methods
Convert between signed and unsigned types of the same integer, assuming that the value is homogeneous over the conversion.
Panics
Panics if the value is out of range after conversion.
fn lossy_float<T>(self) -> T where
Self: LossyFloat<T>,
fn lossy_float<T>(self) -> T where
Self: LossyFloat<T>,
Downscale the precision of a floating point value.
Panics
Panics if the value is infinite after conversion.
Reduce the size of an integer, assuming that the value is within the range of the new type.
Panics
Panics if the value is out of range after conversion.
fn small_float<T>(self) -> T where
Self: SmallFloat<T>,
fn small_float<T>(self) -> T where
Self: SmallFloat<T>,
Converts an integer to a floating point value, assuming that the value can be losslessly represented in the new type.
Panics
Panics if the value is infinite after conversion.
Converts a floating point value to an integer
by calling the f32::trunc
/f64::trunc
method.
Panics
Panics if the truncated integer is not in the range of the output type.