Skip to main content

OpsIndex

Trait OpsIndex 

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

    // Required method
    fn index(&self, index: Idx) -> &Self::Output;
}

Required Associated Types§

Source

type Output: ?Sized

The returned type after indexing.

Required Methods§

Source

fn index(&self, index: Idx) -> &Self::Output

Performs the indexing (container[index]) operation.

§Panics

May panic if the index is out of bounds.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<I> OpsIndex<I> for Value
where I: Index,