Function bitvec::ptr::read

source · []
pub unsafe fn read<O, T>(src: BitPtr<Const, O, T>) -> bool where
    O: BitOrder,
    T: BitStore
Expand description

Reads the bit from src.

Original

ptr::read

Safety

Behavior is undefined if any of the following conditions are violated:

  • src must be valid for reads.
  • src must point to a properly initialized value of type T.

Examples

use bitvec::prelude::*;

let data = 128u8;
let ptr = BitPtr::<_, Msb0, _>::from_ref(&data);
assert!(unsafe {
  bitvec::ptr::read(ptr)
});