Skip to main content

Any

Trait Any 

Source
pub trait Any {
    type Item;

    // Required method
    fn any<F>(&self, predicate: F) -> bool
       where F: FnMut(&Self::Item) -> bool;
}
Expand description

Provides a predicate that checks whether at least one item matches.

Required Associated Types§

Required Methods§

Source

fn any<F>(&self, predicate: F) -> bool
where F: FnMut(&Self::Item) -> bool,

Returns true when any item matches 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<T> Any for [T]

Source§

type Item = T

Source§

fn any<F>(&self, predicate: F) -> bool
where F: FnMut(&Self::Item) -> bool,

Implementors§