[][src]Trait indexing::traits::TrustedContainer

pub unsafe trait TrustedContainer {
type Item: ?Sized + TrustedItem<Self>;
type Slice: ?Sized;
    fn unit_len(&self) -> usize;
unsafe fn get_unchecked(&self, i: usize) -> &Self::Item;
unsafe fn slice_unchecked(&self, r: Range<usize>) -> &Self::Slice; }

Types that can back a trusted container: it can have indices and ranges that are trusted to be in bounds.

It must have a continuously addressable range.

Associated Types

type Item: ?Sized + TrustedItem<Self>

type Slice: ?Sized

Loading content...

Required methods

fn unit_len(&self) -> usize

The length of the container in base item units.

unsafe fn get_unchecked(&self, i: usize) -> &Self::Item

unsafe fn slice_unchecked(&self, r: Range<usize>) -> &Self::Slice

Loading content...

Implementations on Foreign Types

impl<T: TrustedContainer + ?Sized, '_> TrustedContainer for &'_ T[src]

type Item = T::Item

type Slice = T::Slice

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

type Item = T

type Slice = [T]

impl<T: TrustedContainer + ?Sized> TrustedContainer for Box<T>[src]

type Item = T::Item

type Slice = T::Slice

impl<T> TrustedContainer for Vec<T>[src]

type Item = T

type Slice = [T]

impl TrustedContainer for str[src]

type Item = Character

type Slice = str

impl TrustedContainer for String[src]

type Item = Character

type Slice = str

Loading content...

Implementors

Loading content...