[][src]Trait take_if::TakeIf

pub trait TakeIf {
    type Inner;
    fn take_if<F: FnOnce(&Self::Inner) -> bool>(
        &mut self,
        predicate: F
    ) -> Option<Self::Inner>; }

Extension trait for Option<T> that adds the take_if method.

See the crate-level documentation for more information.

Associated Types

type Inner

The type contained in the Option.

Loading content...

Required methods

fn take_if<F: FnOnce(&Self::Inner) -> bool>(
    &mut self,
    predicate: F
) -> Option<Self::Inner>

Takes value out of the Option if predicate returns true.

See the crate-level documentation for more information.

Loading content...

Implementations on Foreign Types

impl<T> TakeIf for Option<T>[src]

type Inner = T

Loading content...

Implementors

Loading content...