Skip to main content

OptionIndexed

Trait OptionIndexed 

Source
pub trait OptionIndexed<'value> {
    type Value;

    // Required methods
    fn index(&self) -> Option<usize>;
    fn value(&self) -> Option<&'value Self::Value>;
}
Expand description

Split an Option<Indexed<'a, Value>> into its index (Option<usize>) or value (Option<&Value>).

Required Associated Types§

Source

type Value

The Value in Option<Indexed<'a, Value>>.

Required Methods§

Source

fn index(&self) -> Option<usize>

Pull the index out of an Option<Indexed<'a, Value>> if it exists.

Source

fn value(&self) -> Option<&'value Self::Value>

Pull the value out of an Option<Indexed<'a, Value>> if it exists.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementations on Foreign Types§

Source§

impl<'value, Value> OptionIndexed<'value> for Option<Indexed<'value, Value>>

Source§

type Value = Value

Source§

fn index(&self) -> Option<usize>

Source§

fn value(&self) -> Option<&'value Self::Value>

Implementors§