[−][src]Struct unicycle::AtomicBitSet
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
impl RefUnwindSafe for AtomicBitSet
impl Send for AtomicBitSet
impl Sync for AtomicBitSet
impl Unpin for AtomicBitSet
impl UnwindSafe for AtomicBitSet
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,