pub trait Set<T: DataTrait + ?Sized>: Data {
// Required methods
fn len(&self) -> usize;
fn clear(&mut self);
fn insert_val(&mut self, val: &mut T);
fn insert_ref(&mut self, val: &T);
fn dyn_iter<'a>(&'a self) -> Box<dyn Iterator<Item = &'a T> + 'a>;
fn as_set(&self) -> &DynSet<T>;
fn as_set_mut(&mut self) -> &mut DynSet<T>;
// Provided method
fn is_empty(&self) -> bool { ... }
}Expand description
A dynamically typed interface to BTreeSet.
Required Methods§
Sourcefn insert_val(&mut self, val: &mut T)
fn insert_val(&mut self, val: &mut T)
Add a value to the set without cloning.
Sets val to the default value.
Sourcefn insert_ref(&mut self, val: &T)
fn insert_ref(&mut self, val: &T)
Add a value to the set, cloning it from val.
Sourcefn dyn_iter<'a>(&'a self) -> Box<dyn Iterator<Item = &'a T> + 'a>
fn dyn_iter<'a>(&'a self) -> Box<dyn Iterator<Item = &'a T> + 'a>
Return an iterator over items in self.
Sourcefn as_set(&self) -> &DynSet<T>
fn as_set(&self) -> &DynSet<T>
Cast any trait object that implements this trait to &DynSet.
This method will not be needed once trait downcasting has been stabilized.
Sourcefn as_set_mut(&mut self) -> &mut DynSet<T>
fn as_set_mut(&mut self) -> &mut DynSet<T>
Cast any trait object that implements this trait to &mut DynSet.
This method will not be needed once trait downcasting has been stabilized.
Provided Methods§
Blanket Implementations§
Source§impl<V, T> Erase<dyn Set<T>> for Vwhere
V: Set<T> + ArchivedDBData,
DeserializeImpl<V, dyn Set<T>>: DeserializeDyn<dyn Set<T>>,
T: DataTrait + ?Sized,
impl<V, T> Erase<dyn Set<T>> for Vwhere
V: Set<T> + ArchivedDBData,
DeserializeImpl<V, dyn Set<T>>: DeserializeDyn<dyn Set<T>>,
T: DataTrait + ?Sized,
Source§fn erase(&self) -> &(dyn Set<T> + 'static)
fn erase(&self) -> &(dyn Set<T> + 'static)
Convert a reference to
self into a reference to Trait.Source§fn erase_mut(&mut self) -> &mut (dyn Set<T> + 'static)
fn erase_mut(&mut self) -> &mut (dyn Set<T> + 'static)
Convert a mutable reference to
self into a mutable reference to Trait.Source§fn erase_archived(
archived: &<V as Archive>::Archived,
) -> &<dyn Set<T> as ArchiveTrait>::Archived
fn erase_archived( archived: &<V as Archive>::Archived, ) -> &<dyn Set<T> as ArchiveTrait>::Archived
Convert a reference to an archived representation of
Self into a reference
to a trait object of type Trait::Archived.Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".