Skip to main content

SetLike

Trait SetLike 

Source
pub trait SetLike {
    type Item: Hash + Eq + Display + Clone;

    // Required methods
    fn contains(&self, item: &Self::Item) -> bool;
    fn is_empty(&self) -> bool;
}
Expand description

Represents a generic set-like container with members.

Required Associated Types§

Source

type Item: Hash + Eq + Display + Clone

The type of items stored in the set.

Required Methods§

Source

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

Returns true if the set contains the specified item.

Source

fn is_empty(&self) -> bool

Returns true if the set is empty.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementations on Foreign Types§

Source§

impl<T, S> SetLike for AHashSet<T, S>
where T: Eq + Hash + Display + Clone, S: BuildHasher,

Source§

type Item = T

Source§

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

Source§

fn is_empty(&self) -> bool

Source§

impl<T, S> SetLike for HashSet<T, S>
where T: Eq + Hash + Display + Clone, S: BuildHasher,

Source§

type Item = T

Source§

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

Source§

fn is_empty(&self) -> bool

Source§

impl<T, S> SetLike for IndexSet<T, S>
where T: Eq + Hash + Display + Clone, S: BuildHasher,

Source§

type Item = T

Source§

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

Source§

fn is_empty(&self) -> bool

Implementors§