[][src]Enum bitvec::domain::BitDomain

pub enum BitDomain<'a, O, T> where
    O: BitOrder,
    T: 'a + BitStore
{ Enclave { head: BitIdx<T::Mem>, body: &'a BitSlice<O, T>, tail: BitTail<T::Mem>, }, Region { head: &'a BitSlice<O, T>, body: &'a BitSlice<O, T::Mem>, tail: &'a BitSlice<O, T>, }, }

Granular representation of the memory region containing a BitSlice.

BitSlice regions can be described in terms of edge and center elements, where the edge elements retain the aliasing status of the source BitSlice handle, and the center elements are 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 subregion of memory that no longer requires them for correct access.

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 provide references to the underlying memory elements. If you need such access directly, 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 element type of the source BitSlice handle, including 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 element.

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 BitSlice<O, T>

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

tail: BitTail<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 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 BitSlice<O, T::Mem>

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 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> BitDomain<'a, O, T> where
    O: BitOrder,
    T: 'a + BitStore
[src]

pub fn enclave(
    self
) -> Option<(BitIdx<T::Mem>, &'a BitSlice<O, T>, BitTail<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 BitSlice<O, T>, &'a BitSlice<O, T::Mem>, &'a 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<O, T, '_> Clone for BitDomain<'_, O, T> where
    O: BitOrder,
    T: BitStore
[src]

impl<O, T, '_> Copy for BitDomain<'_, O, T> where
    O: BitOrder,
    T: BitStore
[src]

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

Auto Trait Implementations

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

impl<'a, O, T> Send for BitDomain<'a, O, T> where
    <T as BitStore>::Mem: BitStore + Send,
    <T as BitStore>::Threadsafe: Sync,
    <<T as BitStore>::Mem as BitStore>::Threadsafe: Sync

impl<'a, O, T> Sync for BitDomain<'a, O, T> where
    <T as BitStore>::Mem: BitStore + Sync,
    <T as BitStore>::Threadsafe: Sync,
    <<T as BitStore>::Mem as BitStore>::Threadsafe: Sync

impl<'a, O, T> Unpin for BitDomain<'a, O, T> where
    <T as BitStore>::Mem: Unpin

impl<'a, O, T> UnwindSafe for BitDomain<'a, O, T> where
    O: RefUnwindSafe,
    T: RefUnwindSafe,
    <T as BitStore>::Mem: RefUnwindSafe + UnwindSafe

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> 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> Pipe for T[src]

impl<T> PipeAsRef for T[src]

impl<T> PipeBorrow for T[src]

impl<T> PipeDeref for T[src]

impl<T> PipeRef for T[src]

impl<T> Tap for T[src]

impl<T> Tap for T[src]

impl<T, U> TapAsRef<U> for T where
    U: ?Sized
[src]

impl<T, U> TapBorrow<U> for T where
    U: ?Sized
[src]

impl<T> TapDeref for T[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> TryConv 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.