std_ext

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>;
}

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>

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>

Implementors§