OptionExt

Trait OptionExt 

Source
pub trait OptionExt: OptionExtSealed {
    type Inner;

    // Required method
    fn try_get_or_insert_with<E, F: FnOnce() -> Result<Self::Inner, E>>(
        &mut self,
        f: F,
    ) -> Result<&mut Self::Inner, E>;
}

Required Associated Types§

Required Methods§

Source

fn try_get_or_insert_with<E, F: FnOnce() -> Result<Self::Inner, E>>( &mut self, f: F, ) -> Result<&mut Self::Inner, E>

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl<A> OptionExt for Option<A>

Source§

type Inner = A

Source§

fn try_get_or_insert_with<E, F: FnOnce() -> Result<A, E>>( &mut self, f: F, ) -> Result<&mut A, E>

Implementors§