Function bitvec::slice::from_raw_parts_unchecked
source · pub unsafe fn from_raw_parts_unchecked<'a, T, O>(
ptr: BitPtr<Const, T, O>,
len: usize
) -> &'a BitSlice<T, O> ⓘwhere
O: BitOrder,
T: 'a + BitStore,
Expand description
Raw Bit-Slice Construction
This is equivalent to slice::from_raw_parts()
, except that it does not check
any of the encoding requirements.
Safety
Callers must both uphold the safety requirements of that function, as well as ensure that the arguments would not cause it to fail gracefully.
Arguments that would cause from_raw_parts
to return Err
instead produce a
bit-slice handle whose value is undefined.
Parameters
ptr
: A bit-pointer to aT
memory element. The pointer’s data address must be well-aligned, the bit-index must be valid forT
, the target region must be initialized forlen
bits.len
: A count of live bits beginning atptr
. It must not exceedMAX_BITS
.
Returns
An exclusive BitSlice
reference over the described region. If either of the
parameters are invalid, then the value of the reference is library-level
undefined.