Skip to main content

Contains

Trait Contains 

Source
pub trait Contains<I> {
    // Required method
    fn contains(&self, item: I) -> bool;
}
Expand description

Types for values that contain items.

At present, these are:

typecontains
&str, String&str, char, &[char] F: FnMut(char) -> bool
Vec<T>T, &T
Option<T>I where T: Contains<I>
form::Result<'_, T>I where T: Contains<I>

Required Methods§

Source

fn contains(&self, item: I) -> bool

Returns true if self contains item.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl Contains<&[char]> for String

Source§

fn contains(&self, item: &[char]) -> bool

Source§

impl Contains<&[char]> for str

Source§

fn contains(&self, item: &[char]) -> bool

Source§

impl Contains<&str> for String

Source§

fn contains(&self, item: &str) -> bool

Source§

impl Contains<&str> for str

Source§

fn contains(&self, item: &str) -> bool

Source§

impl Contains<char> for String

Source§

fn contains(&self, item: char) -> bool

Source§

impl Contains<char> for str

Source§

fn contains(&self, item: char) -> bool

Source§

impl<F> Contains<F> for String
where F: FnMut(char) -> bool,

Source§

fn contains(&self, f: F) -> bool

Source§

impl<F> Contains<F> for str
where F: FnMut(char) -> bool,

Source§

fn contains(&self, f: F) -> bool

Source§

impl<I, T> Contains<I> for &T
where T: Contains<I> + ?Sized,

Source§

fn contains(&self, item: I) -> bool

Source§

impl<I, T> Contains<I> for Option<T>
where T: Contains<I>,

Source§

fn contains(&self, item: I) -> bool

Source§

impl<I, T> Contains<I> for Result<T, Errors<'_>>
where T: Contains<I>,

Source§

fn contains(&self, item: I) -> bool

Source§

impl<T> Contains<&T> for Vec<T>
where T: PartialEq,

Source§

fn contains(&self, item: &T) -> bool

Source§

impl<T> Contains<T> for Vec<T>
where T: PartialEq,

Source§

fn contains(&self, item: T) -> bool

Source§

impl<const N: usize> Contains<&[char; N]> for String

Source§

fn contains(&self, item: &[char; N]) -> bool

Source§

impl<const N: usize> Contains<&[char; N]> for str

Source§

fn contains(&self, item: &[char; N]) -> bool

Implementors§