Function bitvec::slice::from_raw_parts_unchecked
source · [−]pub unsafe fn from_raw_parts_unchecked<'a, O, T>(
data: BitPtr<Const, O, T>,
len: usize
) -> &'a BitSlice<O, T>ⓘ where
O: BitOrder,
T: BitStore,
Expand description
Performs the same functionality as from_raw_parts
, without checking the
len
argument.
Parameters
data
: ABitPtr
to a dereferencable region of memory.len
: The length, in bits, of the region beginning at*data
. This is not checked against the maximum value, and is encoded directly into the bit-slice reference. If it exceedsBitSlice::MAX_BITS
, it will be modulated to fit (the high bits will be discarded).
Returns
A &BitSlice
reference starting at data
and running for len & MAX_BITS
bits.
Safety
See from_raw_parts
.