Trait Indexable

Source
pub trait Indexable {
    type Output;

    // Required method
    fn index(&self, n: usize) -> Option<&Self::Output>;
}
Expand description

A trait for vectored buffers that could be indexed.

Required Associated Types§

Source

type Output

Output item

Required Methods§

Source

fn index(&self, n: usize) -> Option<&Self::Output>

Get the item with specific index.

Implementations on Foreign Types§

Source§

impl<T> Indexable for &[T]

Source§

type Output = T

Source§

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

Source§

impl<T> Indexable for &mut [T]

Source§

type Output = T

Source§

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

Source§

impl<T> Indexable for &T
where T: Indexable,

Source§

type Output = <T as Indexable>::Output

Source§

fn index(&self, n: usize) -> Option<&<T as Indexable>::Output>

Source§

impl<T> Indexable for &mut T
where T: Indexable,

Source§

type Output = <T as Indexable>::Output

Source§

fn index(&self, n: usize) -> Option<&<T as Indexable>::Output>

Source§

impl<T, const N: usize> Indexable for [T; N]

Source§

type Output = T

Source§

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

Implementors§

Source§

impl<T, A> Indexable for Vec<T, A>
where A: Allocator + 'static,

Source§

impl<T, const N: usize> Indexable for ArrayVec<T, N>

Available on crate feature arrayvec only.