Struct linear_collections::VecSet
source · pub struct VecSet<T: Eq> { /* private fields */ }
Implementations§
source§impl<T: Eq> VecSet<T>
impl<T: Eq> VecSet<T>
sourcepub fn with_capacity(capacity: usize) -> Self
pub fn with_capacity(capacity: usize) -> Self
Creates a VecSet that can hold capacity
elements without reallocating
sourcepub fn insert(&mut self, value: T) -> bool
pub fn insert(&mut self, value: T) -> bool
Adds a value to the set. If the set did not previously contain this value, true is returned. If the set already contained this value, false is returned, and the set is not modified: original value is not replaced, and the value passed as argument is dropped.
sourcepub fn remove(&mut self, value: &T) -> Option<T>
pub fn remove(&mut self, value: &T) -> Option<T>
Attempts to remove the referenced value from the set, returning None if it is not present.
sourcepub fn into_inner(self) -> Vec<T>
pub fn into_inner(self) -> Vec<T>
Returns the backing vector of this type
Auto Trait Implementations§
impl<T> Freeze for VecSet<T>
impl<T> RefUnwindSafe for VecSet<T>where
T: RefUnwindSafe,
impl<T> Send for VecSet<T>where
T: Send,
impl<T> Sync for VecSet<T>where
T: Sync,
impl<T> Unpin for VecSet<T>where
T: Unpin,
impl<T> UnwindSafe for VecSet<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