Trait Split

Source
pub trait Split {
    // Required methods
    fn new(n: usize) -> Self;
    fn split(&self, index: usize) -> (usize, usize);
    fn max_nested(&self) -> usize;
}
Expand description

Describe how to split the indices for a NestedArray.

Required Methods§

Source

fn new(n: usize) -> Self

Creates a new Split for a NestedArray with n elements.

Source

fn split(&self, index: usize) -> (usize, usize)

Split index in two indices (main array, nested array).

Source

fn max_nested(&self) -> usize

Returns the maximum index that can be produced to be used in a nested arrays.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§