[][src]Struct wrapping::WrappingArray

pub struct WrappingArray<T, N: ArrayLength<T>>(_);

An array that wraps around its size.

Example

use wrapping::WrappingArray;

let array: [&str; 1] = ["hello"];
let wrapping = WrappingArray::from(array);

assert_eq!(wrapping[0], "hello");
assert_eq!(wrapping[1], "hello");

Methods from Deref<Target = GenericArray<T, N>>

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

Extracts a slice containing the entire array.

Trait Implementations

impl<T, N: ArrayLength<T>> Deref for WrappingArray<T, N>[src]

type Target = GenericArray<T, N>

The resulting type after dereferencing.

impl<T, N: ArrayLength<T>, I: Into<GenericArray<T, N>>> From<I> for WrappingArray<T, N>[src]

impl<T, N: ArrayLength<T>> Index<usize> for WrappingArray<T, N>[src]

type Output = T

The returned type after indexing.

impl<T, N: ArrayLength<T>> IndexMut<usize> for WrappingArray<T, N>[src]

Auto Trait Implementations

impl<T, N> RefUnwindSafe for WrappingArray<T, N> where
    <N as ArrayLength<T>>::ArrayType: RefUnwindSafe

impl<T, N> Send for WrappingArray<T, N> where
    T: Send

impl<T, N> Sync for WrappingArray<T, N> where
    T: Sync

impl<T, N> Unpin for WrappingArray<T, N> where
    <N as ArrayLength<T>>::ArrayType: Unpin

impl<T, N> UnwindSafe for WrappingArray<T, N> where
    <N as ArrayLength<T>>::ArrayType: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.