Enum bitvec::domain::BitDomainMut[][src]

pub enum BitDomainMut<'a, O, T> where
    O: BitOrder,
    T: BitStore
{ Enclave { head: BitIdx<T::Mem>, body: &'a mut BitSlice<O, T>, tail: BitEnd<T::Mem>, }, Region { head: &'a mut BitSlice<O, T>, body: &'a mut BitSlice<O, T::Unalias>, tail: &'a mut BitSlice<O, T>, }, }

Granular representation of the memory region containing a BitSlice.

BitSlice regions can be described in terms of edge and center partitions, where the edge partitions must retain the aliasing status of the source BitSlice handle, and the center partition is known to be completely unaliased by any other view. This property allows any BitSlice handle to be decomposed into smaller regions, and safely remove any aliasing markers from the center partition that no longer requires such safeguarding.

This enum acts like the .split* methods in that it only subdivides the source BitSlice into smaller BitSlices, and makes appropriate modifications to the aliasing markers.

It does not add any aliasing markers: if the slice is marked as aliased, then the edge partitions will retain that marker, and if it is not, then the edge partitions do not need it.

This does not provide references to the underlying memory buffer. If you need such direct access, use the Domain or DomainMut enums.

Lifetimes

  • 'a: The lifetime of the referent storage region.

Type Parameters

  • O: The ordering type of the source BitSlice handle.
  • T: The register type of the source BitSlice handle, including any aliasing markers.

Aliasing Awareness

This enum does not grant access to memory outside the scope of the original BitSlice handle, and so does not need to modfiy any aliasing conditions.

Variants

Enclave

Indicates that a BitSlice is contained entirely in the interior indices of a single memory register.

Fields of Enclave

head: BitIdx<T::Mem>

The start index of the BitSlice.

This is not likely to be useful information, but is retained for structural similarity with the rest of the module.

body: &'a mut BitSlice<O, T>

The original BitSlice used to create this bit-domain view.

tail: BitEnd<T::Mem>

The end index of the BitSlice.

This is not likely to be useful information, but is retained for structural similarity with the rest of the module.

Region

Indicates that a BitSlice region touches at least one edge index of any number of elements.

This contains two BitSlices representing the partially-occupied edge elements, with their original aliasing marker, and one BitSlice representing the fully-occupied interior elements, marked as unaliased.

Fields of Region

head: &'a mut BitSlice<O, T>

Any bits that partially-fill the base element of the slice region.

This does not modify its aliasing status, as it will already be appropriately marked before constructing this view.

body: &'a mut BitSlice<O, T::Unalias>

Any bits inside elements that the source BitSlice completely covers.

This is marked as unaliased, because it is statically impossible for any other handle to have write access to the region it covers. As such, a BitSlice that was marked as entirely aliased, but contains interior unaliased elements, can safely remove its aliasing protections.

tail: &'a mut BitSlice<O, T>

Any bits that partially fill the last element of the slice region.

This does not modify its aliasing status, as it will already be appropriately marked before constructing this view.

Implementations

impl<'a, O, T> BitDomainMut<'a, O, T> where
    O: BitOrder,
    T: BitStore
[src]

pub fn enclave(
    self
) -> Option<(BitIdx<T::Mem>, &'a mut BitSlice<O, T>, BitEnd<T::Mem>)>
[src]

Attempts to view the domain as an enclave variant.

Parameters

  • self

Returns

If self is the Enclave variant, this returns Some of the enclave fields, as a tuple. Otherwise, it returns None.

pub fn region(
    self
) -> Option<(&'a mut BitSlice<O, T>, &'a mut BitSlice<O, T::Unalias>, &'a mut BitSlice<O, T>)>
[src]

Attempts to view the domain as a region variant.

Parameters

  • self

Returns

If self is the Region variant, this returns Some of the region fields, as a tuple. Otherwise, it returns None.

Trait Implementations

impl<'a, O: Debug, T: Debug> Debug for BitDomainMut<'a, O, T> where
    O: BitOrder,
    T: BitStore,
    T::Mem: Debug,
    T::Mem: Debug,
    T::Unalias: Debug
[src]

Auto Trait Implementations

impl<'a, O, T> RefUnwindSafe for BitDomainMut<'a, O, T> where
    O: RefUnwindSafe,
    T: RefUnwindSafe,
    <T as BitStore>::Mem: RefUnwindSafe,
    <T as BitStore>::Unalias: RefUnwindSafe

impl<'a, O, T> Send for BitDomainMut<'a, O, T> where
    T: Sync,
    <T as BitStore>::Unalias: Sync

impl<'a, O, T> Sync for BitDomainMut<'a, O, T> where
    T: Sync,
    <T as BitStore>::Unalias: Sync

impl<'a, O, T> Unpin for BitDomainMut<'a, O, T>

impl<'a, O, T> !UnwindSafe for BitDomainMut<'a, O, T>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Conv for T[src]

impl<T> FmtForward for T[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Pipe for T where
    T: ?Sized
[src]

impl<T> Tap for T[src]

impl<T> TryConv for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.