pub struct CastSet<T: Cast> { /* private fields */ }Expand description
A set implemented for types that can be cast to usize
Implementations§
Source§impl<T: Cast> CastSet<T>
impl<T: Cast> CastSet<T>
Sourcepub fn with_capacity(cap: usize) -> CastSet<T>
pub fn with_capacity(cap: usize) -> CastSet<T>
Creates an empty set with the specified capacity.
Sourcepub fn reserve(&mut self, additional: usize)
pub fn reserve(&mut self, additional: usize)
Reserves capacity for at least additional more elements to be
inserted in the set. The collection may reserve more space
to avoid frequent reallocations.
Sourcepub fn insert(&mut self, elem: T) -> bool
pub fn insert(&mut self, elem: T) -> bool
Adds a value to the set.
If the set did not have this value present, true is returned.
If the set did have this value present, false is returned.
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for CastSet<T>
impl<T> RefUnwindSafe for CastSet<T>where
T: RefUnwindSafe,
impl<T> Send for CastSet<T>where
T: Send,
impl<T> Sync for CastSet<T>where
T: Sync,
impl<T> Unpin for CastSet<T>
impl<T> UnwindSafe for CastSet<T>where
T: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more