pub trait RetainTake<T> {
// Required method
fn retain_take<F>(&mut self, predicate: F) -> Vec<T>
where F: FnMut(&T) -> bool;
}Available on crate feature
alloc only.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§
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.