pub trait Xias {
// Provided methods
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§
Sourcefn homosign<T>(self) -> Twhere
Self: Homosign<T>,
fn homosign<T>(self) -> Twhere
Self: Homosign<T>,
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.
Sourcefn lossy_float<T>(self) -> Twhere
Self: LossyFloat<T>,
fn lossy_float<T>(self) -> Twhere
Self: LossyFloat<T>,
Downscale the precision of a floating point value.
§Panics
Panics if the value is infinite after conversion.
Sourcefn small_int<T>(self) -> Twhere
Self: SmallInt<T>,
fn small_int<T>(self) -> Twhere
Self: SmallInt<T>,
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.
Sourcefn small_float<T>(self) -> Twhere
Self: SmallFloat<T>,
fn small_float<T>(self) -> Twhere
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.
Sourcefn trunc_int<T>(self) -> Twhere
Self: TruncInt<T>,
fn trunc_int<T>(self) -> Twhere
Self: TruncInt<T>,
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.