Function bitvec::slice::bits_from_raw_parts_mut[][src]

pub unsafe fn bits_from_raw_parts_mut<'a, O, T>(
    data: *mut T,
    head: BitIdx<T>,
    bits: usize
) -> &'a mut BitSlice<O, T> where
    O: BitOrder,
    T: 'a + BitStore

Performs the same functionality as bits_from_raw_parts, except that a mutable slice is returned.

This function is unsafe for the same reasons as bits_from_raw_parts, as well as not being able to provide a non-aliasing guarantee of the returned mutable slice. data must be non-null and aligned even for zero-length slices as with bits_from_raw_parts. The total size of the slice must be no larger than BitPtr::<T>::MAX_ELTS elements T in memory.

See the documentation of bits_from_raw_parts for more details.

Safety

Beyond the ordinary Rust requirements for aliasing, this function also requires that the described region, when combined with the O BitOrder type parameter, not cause aliasing with another BitSlice whose head and O arguments cause aliasing in the underlying memory positions.