[][src]Trait indexing::traits::TrustedItem

pub unsafe trait TrustedItem<Array: TrustedContainer<Item = Self> + ?Sized> {
type Unit;
    fn vet<'id, I: Idx>(
        idx: I,
        container: &Container<'id, Array>
    ) -> Result<Index<'id, I, Unknown>, IndexError>;
fn after<'id, I: Idx>(
        this: Index<'id, I, NonEmpty>,
        container: &Container<'id, Array>
    ) -> Index<'id, I, Unknown>;
fn advance<'id, I: Idx>(
        this: Index<'id, I, NonEmpty>,
        container: &Container<'id, Array>
    ) -> Option<Index<'id, I, NonEmpty>>; }

An item within a trusted container.

Associated Types

type Unit

Loading content...

Required methods

fn vet<'id, I: Idx>(
    idx: I,
    container: &Container<'id, Array>
) -> Result<Index<'id, I, Unknown>, IndexError>

Vet an index for being on item boundaries.

The index for the end of the container should pass. This function does not imply a nonempty proof.

fn after<'id, I: Idx>(
    this: Index<'id, I, NonEmpty>,
    container: &Container<'id, Array>
) -> Index<'id, I, Unknown>

Increment an index to the next item, potentially leaving the container.

fn advance<'id, I: Idx>(
    this: Index<'id, I, NonEmpty>,
    container: &Container<'id, Array>
) -> Option<Index<'id, I, NonEmpty>>

Advance an index to the next item, if a next item exists.

Loading content...

Implementors

impl TrustedItem<str> for Character[src]

type Unit = u8

impl TrustedItem<String> for Character[src]

type Unit = u8

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

type Unit = T

impl<T: TrustedItem<[T]>> TrustedItem<Vec<T>> for T[src]

type Unit = T::Unit

impl<T: TrustedItem<Array> + ?Sized, Array: TrustedContainer<Item = T> + ?Sized> TrustedItem<Box<Array>> for T[src]

type Unit = T::Unit

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

type Unit = T::Unit

Loading content...