Skip to main content

TotalSliceExt

Trait TotalSliceExt 

Source
pub trait TotalSliceExt<T: TotalFloat> {
    // Required method
    fn as_primitive_slice(&self) -> &[T];
}
Expand description

Extension trait for viewing a slice of Total values as primitive values.

Required Methods§

Source

fn as_primitive_slice(&self) -> &[T]

Views Total 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::TotalF64;
use range_set_blaze::total::TotalSliceExt;

let totals = [TotalF64::new(1.0), TotalF64::new(2.0), TotalF64::new(3.0)];
assert_eq!(&[1.0, 2.0, 3.0], totals.as_primitive_slice());

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl<T: TotalFloat> TotalSliceExt<T> for [Total<T>]

Implementors§