[][src]Struct unicycle::AtomicBitSet

#[repr(C)]
pub struct AtomicBitSet { /* fields omitted */ }

The same as BitSet, except it provides atomic methods.

BitSet and AtomicBitSet's are guaranteed to have an identical memory layout, so while it would require unsafe, transmuting or coercing between the two is sound assuming the proper synchronization is respected.

We provide the following methods to accomplish this from an atomic bitset, to a local (non atomic) one: as_local_mut for borrowing mutably and into_local.

Methods

impl AtomicBitSet[src]

pub fn new() -> Self[src]

Construct a new, empty atomic bit set.

pub fn set(&self, position: usize)[src]

Set the given bit.

pub fn into_local(self) -> BitSet[src]

Convert in-place into a a BitSet.

Examples

use unicycle::BitSet;

let mut set = BitSet::new();
set.reserve(1024);

let atomic = set.into_atomic();
atomic.set(42);

let set = atomic.into_local();
assert!(set.test(42));

pub fn as_local(&self) -> &BitSet[src]

Convert in-place into a reference to a BitSet.

pub fn as_local_mut(&mut self) -> &mut BitSet[src]

Convert in-place into a mutable reference to a BitSet.

Trait Implementations

impl Default for AtomicBitSet[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.