RetainMut

Trait RetainMut 

Source
pub trait RetainMut<I> {
    // Required method
    fn retain_mut(&mut self, f: impl FnMut(&mut I) -> bool);
}
Expand description

Helper trait to abstract over Vec and SmallVec in Managed::retain.

Required Methods§

Source

fn retain_mut(&mut self, f: impl FnMut(&mut I) -> bool)

Retains only the elements specified by the predicate.

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<I> RetainMut<I> for Vec<I>

Source§

fn retain_mut(&mut self, f: impl FnMut(&mut I) -> bool)

Source§

impl<I, const N: usize> RetainMut<I> for SmallVec<[I; N]>

Source§

fn retain_mut(&mut self, f: impl FnMut(&mut I) -> bool)

Implementors§