Trait brassfibre::prelude::Slicer
[−]
[src]
pub trait Slicer { type Scalar; fn len(&self) -> usize; fn iloc(&self, location: &usize) -> Self::Scalar; unsafe fn iloc_unchecked(&self, location: &usize) -> Self::Scalar; fn ilocs(&self, locations: &[usize]) -> Self; unsafe fn ilocs_unchecked(&self, locations: &[usize]) -> Self; fn ilocs_forced(&self, locations: &[usize]) -> Self; fn blocs(&self, flags: &[bool]) -> Self; fn reindex(&self, locations: &[usize]) -> Self { ... } unsafe fn reindex_unchecked(&self, locations: &[usize]) -> Self { ... } fn reindex_forced(&self, locations: &[usize]) -> Self { ... } }
Indexing methods for 1-dimensional array-likes.
Associated Types
type Scalar
Required Methods
fn len(&self) -> usize
Return the length of myself
fn iloc(&self, location: &usize) -> Self::Scalar
unsafe fn iloc_unchecked(&self, location: &usize) -> Self::Scalar
Return a single element specified with the location
fn ilocs(&self, locations: &[usize]) -> Self
unsafe fn ilocs_unchecked(&self, locations: &[usize]) -> Self
Return multiple elements specified with the locations
fn ilocs_forced(&self, locations: &[usize]) -> Self
Return multiple elements specified with the locations
If specified locations outs of bounds, corresponding element is filled with null
fn blocs(&self, flags: &[bool]) -> Self
Return multilpe elements specified with bool flags
Provided Methods
fn reindex(&self, locations: &[usize]) -> Self
unsafe fn reindex_unchecked(&self, locations: &[usize]) -> Self
Return multiple elements specified with the locations
fn reindex_forced(&self, locations: &[usize]) -> Self
Return multiple elements specified with the locations
If specified locations outs of bounds, corresponding element is filled with null