pub trait SetStorage<T>: Sized {
type Iter<'this>: Iterator<Item = T>
where Self: 'this;
type IntoIter: Iterator<Item = T>;
// Required methods
fn empty() -> Self;
fn len(&self) -> usize;
fn is_empty(&self) -> bool;
fn insert(&mut self, value: T) -> bool;
fn contains(&self, value: T) -> bool;
fn remove(&mut self, value: T) -> bool;
fn retain<F>(&mut self, f: F)
where F: FnMut(T) -> bool;
fn clear(&mut self);
fn iter(&self) -> Self::Iter<'_>;
fn into_iter(self) -> Self::IntoIter;
}
Expand description
Required Associated Types§
Required Methods§
Sourcefn insert(&mut self, value: T) -> bool
fn insert(&mut self, value: T) -> bool
This is the storage abstraction for Set::insert
.
Sourcefn contains(&self, value: T) -> bool
fn contains(&self, value: T) -> bool
This is the storage abstraction for Set::contains
.
Sourcefn remove(&mut self, value: T) -> bool
fn remove(&mut self, value: T) -> bool
This is the storage abstraction for Set::remove
.
Sourcefn retain<F>(&mut self, f: F)
fn retain<F>(&mut self, f: F)
This is the storage abstraction for Set::retain
.
Sourcefn clear(&mut self)
fn clear(&mut self)
This is the storage abstraction for Set::clear
.
Sourcefn into_iter(self) -> Self::IntoIter
fn into_iter(self) -> Self::IntoIter
This is the storage abstraction for Set::into_iter
.
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.