pub trait RetainTake<T> {
    // Required method
    fn retain_take<F>(&mut self, predicate: F) -> Vec<T>
       where F: FnMut(&T) -> bool;
}
Expand description

The retain+take operation is exactly what it sounds like. Retain only those elements that match the predicate, but return whole owned copies of the items. For efficiency’s sake, some implementations may iterate backwards through the container.

Required Methods§

source

fn retain_take<F>(&mut self, predicate: F) -> Vec<T>
where F: FnMut(&T) -> bool,

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl<T> RetainTake<T> for VecDeque<T>

source§

fn retain_take<F>(&mut self, predicate: F) -> Vec<T>
where F: FnMut(&T) -> bool,

source§

impl<T> RetainTake<T> for Vec<T>

source§

fn retain_take<F>(&mut self, predicate: F) -> Vec<T>
where F: FnMut(&T) -> bool,

Implementors§