Struct MultiArray

Source
pub struct MultiArray<T: Sized, S: Shape> {
    pub shape: S,
    /* private fields */
}

Fields§

§shape: S

Implementations§

Source§

impl<T: Sized, S: Shape> MultiArray<T, S>

Source

pub fn new(shape: S) -> Self
where T: Default,

Source

pub fn new_with(shape: S, value: T) -> Self
where T: Clone,

Source

pub fn new_by<G>(shape: S, generator: G) -> Self
where G: Fn(usize, &<S as Shape>::VectorType) -> T,

Source

pub fn get( &self, vector: S::DummyVectorType, ) -> Result<Vec<&T>, OutOfShapeError>

Source

pub fn iter(&self) -> impl Iterator<Item = &T>

Source

pub fn iter_mut(&mut self) -> impl Iterator<Item = &mut T>

Trait Implementations§

Source§

impl<T: Sized, S: Shape> Index<&<S as Shape>::VectorType> for MultiArray<T, S>

Source§

type Output = T

The returned type after indexing.
Source§

fn index(&self, vector: &S::VectorType) -> &T

Performs the indexing (container[index]) operation. Read more
Source§

impl<T: Sized, S: Shape> Index<usize> for MultiArray<T, S>

Source§

type Output = T

The returned type after indexing.
Source§

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

Performs the indexing (container[index]) operation. Read more
Source§

impl<T: Sized, S: Shape> IndexMut<&<S as Shape>::VectorType> for MultiArray<T, S>

Source§

fn index_mut(&mut self, vector: &S::VectorType) -> &mut T

Performs the mutable indexing (container[index]) operation. Read more
Source§

impl<T: Sized, S: Shape> IndexMut<usize> for MultiArray<T, S>

Source§

fn index_mut(&mut self, index: usize) -> &mut T

Performs the mutable indexing (container[index]) operation. Read more

Auto Trait Implementations§

§

impl<T, S> Freeze for MultiArray<T, S>
where S: Freeze,

§

impl<T, S> RefUnwindSafe for MultiArray<T, S>

§

impl<T, S> Send for MultiArray<T, S>
where S: Send, T: Send,

§

impl<T, S> Sync for MultiArray<T, S>
where S: Sync, T: Sync,

§

impl<T, S> Unpin for MultiArray<T, S>
where S: Unpin, T: Unpin,

§

impl<T, S> UnwindSafe for MultiArray<T, S>
where S: UnwindSafe, T: UnwindSafe,

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> 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, 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.