Struct Array

Source
pub struct Array<'n, T>(/* private fields */);
Expand description

Array of length equal to the value tied to 'n.

Implementations§

Source§

impl<'n, T> Array<'n, T>

Source

pub fn from_ref<'a>(slice: &'a [T], size: Size<'n>) -> &'a Self

Returns a constrained array after checking that its length matches size.

Source

pub fn from_mut<'a>(slice: &'a mut [T], size: Size<'n>) -> &'a mut Self

Returns a constrained array after checking that its length matches size.

Source

pub fn as_ref(&self) -> &[T]

Returns the unconstrained slice.

Source

pub fn as_mut<'a>(&mut self) -> &'a mut [T]

Returns the unconstrained slice.

Source

pub fn len(&self) -> Size<'n>

Returns the length of self.

Trait Implementations§

Source§

impl<T: Debug> Debug for Array<'_, T>

Source§

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

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

impl<'n, T> Index<Idx<'n, usize>> for Array<'n, T>

Source§

type Output = T

The returned type after indexing.
Source§

fn index(&self, idx: Idx<'n, usize>) -> &Self::Output

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

impl<'n, T> Index<Range<IdxInclusive<'n, usize>>> for Array<'n, T>

Source§

type Output = [T]

The returned type after indexing.
Source§

fn index(&self, idx: Range<IdxInclusive<'n, usize>>) -> &Self::Output

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

impl<'n, T> IndexMut<Idx<'n, usize>> for Array<'n, T>

Source§

fn index_mut(&mut self, idx: Idx<'n, usize>) -> &mut Self::Output

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

impl<'n, T> IndexMut<Range<IdxInclusive<'n, usize>>> for Array<'n, T>

Source§

fn index_mut( &mut self, idx: Range<IdxInclusive<'n, usize>>, ) -> &mut Self::Output

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

impl<'n, T: Ord> Ord for Array<'n, T>

Source§

fn cmp(&self, other: &Array<'n, T>) -> Ordering

This method returns an Ordering between self and other. Read more
Source§

impl<'n, T: PartialEq> PartialEq for Array<'n, T>

Source§

fn eq(&self, other: &Array<'n, T>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<'n, T: PartialOrd> PartialOrd for Array<'n, T>

Source§

fn partial_cmp(&self, other: &Array<'n, T>) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · Source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · Source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · Source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · Source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl<'n, T: Eq> Eq for Array<'n, T>

Source§

impl<'n, T> StructuralPartialEq for Array<'n, T>

Auto Trait Implementations§

§

impl<'n, T> Freeze for Array<'n, T>
where T: Freeze,

§

impl<'n, T> RefUnwindSafe for Array<'n, T>
where T: RefUnwindSafe,

§

impl<'n, T> Send for Array<'n, T>
where T: Send,

§

impl<'n, T> !Sized for Array<'n, T>

§

impl<'n, T> Sync for Array<'n, T>
where T: Sync,

§

impl<'n, T> Unpin for Array<'n, T>
where T: Unpin,

§

impl<'n, T> UnwindSafe for Array<'n, T>
where 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