pub struct Set<K: Split> { /* private fields */ }Expand description
Non-concurrent set.
Implementations§
Source§impl<K> Set<K>where
K: Split,
impl<K> Set<K>where
K: Split,
Sourcepub fn contains(&self, key: &K::Borrowed) -> bool
pub fn contains(&self, key: &K::Borrowed) -> bool
Returns true if this set contains key.
§Examples
use arctic::sequential;
let mut set = sequential::Set::<[u8; 4]>::new();
let key = [8, 2, 3, 255];
assert!(set.insert(&key), "Key is not present");
assert!(set.contains(&key), "Key is present");
Sourcepub fn insert(&mut self, key: K::Insert<'_>) -> bool
pub fn insert(&mut self, key: K::Insert<'_>) -> bool
Insert key into this set.
Returns true if successful, i.e., the key was not present and was newly inserted.
§Examples
use arctic::sequential;
let mut set = sequential::Set::<u128>::new();
assert!(set.insert(5), "Key is not present");
assert!(!set.insert(5), "Key is present");Trait Implementations§
Auto Trait Implementations§
impl<K> !Freeze for Set<K>
impl<K> !Send for Set<K>
impl<K> !Sync for Set<K>
impl<K> RefUnwindSafe for Set<K>
impl<K> Unpin for Set<K>
impl<K> UnsafeUnpin for Set<K>
impl<K> UnwindSafe for Set<K>
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