Skip to main content

Set

Struct Set 

Source
pub struct Set<K: Split> { /* private fields */ }
Expand description

Non-concurrent set.

Implementations§

Source§

impl<K> Set<K>
where K: Split,

Source

pub const fn new() -> Self

Constructs a new empty set. Does not allocate.

Source

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");
Source

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§

Source§

impl<K> Default for Set<K>
where K: Split,

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

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>
where <K as Key>::Edge: RefUnwindSafe,

§

impl<K> Unpin for Set<K>
where <K as Key>::Edge: Unpin,

§

impl<K> UnsafeUnpin for Set<K>

§

impl<K> UnwindSafe for Set<K>
where <K as Key>::Edge: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, S> SimdFrom<T, S> for T
where S: Simd,

Source§

fn simd_from(_simd: S, value: T) -> T

Source§

impl<F, T, S> SimdInto<T, S> for F
where T: SimdFrom<F, S>, S: Simd,

Source§

fn simd_into(self, simd: S) -> T

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.