Struct MultiArrayView

Source
pub struct MultiArrayView<'a, Ts>{ /* 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>

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>

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,

Source§

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

The type of the elements being iterated over.
Source§

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,

Source§

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

The type of the elements being iterated over.
Source§

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> Freeze for MultiArrayView<'a, Ts>

§

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

§

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>

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

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

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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 T
where 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 T
where T: Clone,

Source§

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 T
where U: Into<T>,

Source§

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 T
where U: TryFrom<T>,

Source§

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.