pub trait NotNanSliceExt<T: NotNanFloat> {
// Required method
fn as_primitive_slice(&self) -> &[T];
}Expand description
Extension trait for viewing a slice of NotNan values as primitive values.
Required Methods§
Sourcefn as_primitive_slice(&self) -> &[T]
fn as_primitive_slice(&self) -> &[T]
Views NotNan values as primitive values.
“Primitive” here means Rust’s built-in float type (e.g. f64).
This runs in O(1) and does not allocate.
§Examples
use range_set_blaze::NotNanF64;
use range_set_blaze::not_nan::NotNanSliceExt;
let not_nans = [NotNanF64::new(1.0), NotNanF64::new(2.0), NotNanF64::new(3.0)];
assert_eq!(&[1.0, 2.0, 3.0], not_nans.as_primitive_slice());Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".