TryIndex

Trait TryIndex 

Source
pub trait TryIndex<Idx> {
    type Error;
    type Output: ?Sized;

    // Required method
    fn try_index(&self, index: Idx) -> Result<&Self::Output, Self::Error>;
}
Expand description

Required Associated Types§

Source

type Error

The type returned in the event of an error.

Source

type Output: ?Sized

The type returned after performing the operation.

Required Methods§

Source

fn try_index(&self, index: Idx) -> Result<&Self::Output, Self::Error>

The fallible equivalent of Index::index.

Implementors§

Source§

impl<T: Index<Idx>, Idx> TryIndex<Idx> for T