pub trait LabelledArray<E, L>: CopyMap<usize, E> {
// Required methods
fn with_label<F>(label: L, len: usize, func: F) -> Self
where F: FnMut(&mut L, usize) -> E;
fn get_label(&self) -> &L;
unsafe fn get_unchecked(&self, idx: usize) -> &E;
}
Expand description
Array with an optional label struct stored next to the data.
Required Methods§
Sourcefn with_label<F>(label: L, len: usize, func: F) -> Self
fn with_label<F>(label: L, len: usize, func: F) -> Self
Create a new array, with values initialized using a provided function, and label initialized to a provided value.
Sourceunsafe fn get_unchecked(&self, idx: usize) -> &E
unsafe fn get_unchecked(&self, idx: usize) -> &E
Get a reference to the element at a specified index. Implementations of this method shouldn’t do any safety checks.
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.