pub struct MultiArrayView<'a, Ts>where
    Ts: VariadicRefFactory,{ /* private fields */ }
Expand description

A read-only view on a multivector.

For the detailed description of multivector and examples, cf. MultiVector.

Implementations§

source§

impl<'a, Ts> MultiArrayView<'a, Ts>where Ts: VariadicRefFactory,

source

pub fn new(index: &'a [Ts::Index], data: &'a [u8]) -> Self

Creates a new MultiArrayView to the data at the given address.

The returned array view does not own the data.

source

pub fn len(&self) -> usize

Number of indexed items in the array.

Note that this is not the total number of overall elements stored in the array. An item may be also empty.

source

pub fn is_empty(&self) -> bool

Returns true if no item is stored in the array.

source

pub fn at(&self, index: usize) -> MultiArrayViewItemIter<'a, Ts>

Returns a read-only iterator to the elements of the item at position index.

Panics

Panics if index is greater than or equal to MultiArrayView::len().

source

pub fn slice<R: SliceIndex<[Ts::Index], Output = [Ts::Index]>>( &self, range: R ) -> Self

Slice this array view by a given range.

Panics

Panics if the range is outside of bounds of array view.

source

pub fn iter(&self) -> MultiArrayViewIter<'a, Ts>

Returns an iterator through the indexed items of the array.

Trait Implementations§

source§

impl<'a, Ts> Clone for MultiArrayView<'a, Ts>where Ts: VariadicRefFactory,

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<'a, Ts> Debug for MultiArrayView<'a, Ts>where Ts: VariadicRefFactory + 'a,

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'a, Ts> IntoIterator for &MultiArrayView<'a, Ts>where Ts: VariadicRefFactory + 'a,

§

type Item = <MultiArrayViewIter<'a, Ts> as Iterator>::Item

The type of the elements being iterated over.
§

type IntoIter = MultiArrayViewIter<'a, Ts>

Which kind of iterator are we turning this into?
source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more
source§

impl<'a, Ts> IntoIterator for MultiArrayView<'a, Ts>where Ts: VariadicRefFactory + 'a,

§

type Item = <MultiArrayViewIter<'a, Ts> as Iterator>::Item

The type of the elements being iterated over.
§

type IntoIter = MultiArrayViewIter<'a, Ts>

Which kind of iterator are we turning this into?
source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more

Auto Trait Implementations§

§

impl<'a, Ts> RefUnwindSafe for MultiArrayView<'a, Ts>where <Ts as VariadicIndex>::Index: RefUnwindSafe,

§

impl<'a, Ts> Send for MultiArrayView<'a, Ts>where <Ts as VariadicIndex>::Index: Sync,

§

impl<'a, Ts> Sync for MultiArrayView<'a, Ts>where <Ts as VariadicIndex>::Index: Sync,

§

impl<'a, Ts> Unpin for MultiArrayView<'a, Ts>

§

impl<'a, Ts> UnwindSafe for MultiArrayView<'a, Ts>where <Ts as VariadicIndex>::Index: RefUnwindSafe,

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.