pub trait AsBitsMut<T> where
    T: BitStore
{ fn as_bits_mut<O>(&mut self) -> &mut BitSlice<O, T>
    where
        O: BitOrder
; }
Expand description

Views a region as a mutable bit-slice.

This trait is an analogue to the AsMut trait, in that it enables any type to provide a mutable view of a bit slice.

It does not require an AsMut<[T: BitStore]> implementation, and a blanket implementation for all such types is provided. This allows you to choose whether to implement only one of AsBitsMut<T> or AsMut<[T]>, and gain a bit-slice view with either choice.

Type Parameters

  • T: The underlying storage region.

Notes

You are not forbidden from creating multiple views with different element types to the same region, but doing so is likely to cause inconsistent and unsurprising behavior.

Refrain from implementing this trait with more than one storage argument unless you are sure that you can uphold the memory region requirements of all of them, and are aware of the behavior conflicts that may arise.

Required methods

Views memory as a slice of mutable bits.

Type Parameters
  • O: The bit ordering used for the region.
Parameters
  • &mut self: The value that is providing a bit-slice view.
Returns

A mutable view into some bits.

Implementors