Trait OptionExt

Source
pub trait OptionExt: Option {
    // Required method
    fn or_warn_with<E: Error>(self, error: E, warn: &mut impl Warn<E>) -> Self;
}
Expand description

Integration between Option and Warn

Note that this trait is sealed, so it is implemented for Option<T> and cannot be implemented for anything else.

Required Methods§

Source

fn or_warn_with<E: Error>(self, error: E, warn: &mut impl Warn<E>) -> Self

Yield error error into sink warn if the option contains None. The option is returned unchanged.

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<T> OptionExt for Option<T>

Source§

fn or_warn_with<E: Error>(self, error: E, warn: &mut impl Warn<E>) -> Self

Implementors§