pub struct Set<T> { /* private fields */ }
Expand description
A set of values held in a linked list.
Implementations§
Source§impl<T> Set<T>
impl<T> Set<T>
Sourcepub fn try_insert(&self, value: T) -> boolwhere
T: Eq,
pub fn try_insert(&self, value: T) -> boolwhere
T: Eq,
Try to insert a value into the set. Returns true
if the value was
inserted or false
if the value was already considered present.
Sourcepub fn wait_to_insert(&self, value: T)where
T: Eq,
Available on crate feature std
only.
pub fn wait_to_insert(&self, value: T)where
T: Eq,
std
only.If the value provided is not in the set, insert it. Otherwise, block
the current thread until another thread calls remove
for the given
value (if multiple threads are waiting, only one of them will
return).
Trait Implementations§
Auto Trait Implementations§
impl<T> !Freeze for Set<T>
impl<T> RefUnwindSafe for Set<T>
impl<T> Send for Set<T>
impl<T> Sync for Set<T>
impl<T> Unpin for Set<T>
impl<T> UnwindSafe for Set<T>where
T: RefUnwindSafe,
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