Trait bitvec::access::BitSafe[][src]

pub trait BitSafe {
    type Mem: BitRegister;
    type Rad: Radium<Item = Self::Mem>;
    fn load(&self) -> Self::Mem;
fn store(&mut self, value: Self::Mem); }

Restricts memory modification to only exclusive references.

The shared-mutability types do not permit locking their references to prevent writing through them when inappropriate. Implementors of this trait are able to view aliased memory and handle other references writing to it, even though they themselves may be forbidden from doing so.

Associated Types

type Mem: BitRegister[src]

The register type being guarded against shared mutation.

This is only present as an extra proof that the type graph all uses the same underlying integers.

type Rad: Radium<Item = Self::Mem>[src]

The accessor type being prevented from mutating while shared.

This is exposed as an associated type so that BitStore can name it without having to re-select it based on crate configuration.

Loading content...

Required methods

fn load(&self) -> Self::Mem[src]

Reads the value out of memory only if a shared reference to the location can be produced.

fn store(&mut self, value: Self::Mem)[src]

Writes a value into memory only if an exclusive reference to the location can be produced.

Loading content...

Implementors

impl BitSafe for BitSafeU8[src]

type Mem = u8

type Rad = RadiumU8

impl BitSafe for BitSafeU16[src]

type Mem = u16

type Rad = RadiumU16

impl BitSafe for BitSafeU32[src]

type Mem = u32

type Rad = RadiumU32

impl BitSafe for BitSafeU64[src]

type Mem = u64

type Rad = RadiumU64

impl BitSafe for BitSafeUsize[src]

type Mem = usize

type Rad = RadiumUsize

Loading content...