VecExt

Trait VecExt 

Source
pub trait VecExt<T> {
    // Required methods
    fn any<F: Fn(&T) -> bool>(&self, f: F) -> bool;
    fn fold<F, U>(&self, f: F, init: U) -> U
       where F: Fn(U, &T) -> U;
    fn into_first(self) -> Option<T>;
    fn into_last(self) -> Option<T>;
    fn recollect<U: From<T>>(self) -> Vec<U>;
    fn merge_grouped<U>(
        &mut self,
        children: Vec<U>,
        matcher: impl Fn(&T, &U) -> bool,
        merger: impl Fn(&mut T, U),
    );
}

Required Methods§

Source

fn any<F: Fn(&T) -> bool>(&self, f: F) -> bool

Source

fn fold<F, U>(&self, f: F, init: U) -> U
where F: Fn(U, &T) -> U,

Source

fn into_first(self) -> Option<T>

Source

fn into_last(self) -> Option<T>

Source

fn recollect<U: From<T>>(self) -> Vec<U>

Source

fn merge_grouped<U>( &mut self, children: Vec<U>, matcher: impl Fn(&T, &U) -> bool, merger: impl Fn(&mut T, U), )

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> VecExt<T> for Vec<T>

Source§

fn any<F: Fn(&T) -> bool>(&self, f: F) -> bool

Source§

fn fold<F, U>(&self, f: F, init: U) -> U
where F: Fn(U, &T) -> U,

Source§

fn into_first(self) -> Option<T>

Source§

fn into_last(self) -> Option<T>

Source§

fn recollect<U: From<T>>(self) -> Vec<U>

Source§

fn merge_grouped<U>( &mut self, children: Vec<U>, matcher: impl Fn(&T, &U) -> bool, merger: impl Fn(&mut T, U), )

Implementors§