Struct bitvec::index::BitTail[][src]

#[repr(transparent)]pub struct BitTail<R> where
    R: BitRegister
{ /* fields omitted */ }

A semantic index counter within or one bit past the end of a register element R.

This type is a counter in the ring 0 ..= R::BITS, and serves to mark a semantic index of a dead bit after a live region. As such, following in the C++ and LLVM memory model of first-live/first-dead region descriptiors, it marks an endpoint outside some bit-region, and may be used to compute the startpoint of a bit-region immediately succeeding, but not overlapping, the source.

As a dead-bit index, this cannot be used for indexing into a register. It is used only in abstract region computation.

This type is necessary in order to preserve the distinction between a dead memory address that is not part of a buffer and a live memory address that is within a region. BitIdx is insufficient to this task, and causes buffer management errors when used in its stead.

Type Parameters

  • R: The register element that this end index governs.

Validity

Values of this type are required to be in the range 0 ..= R::BITS. Any value greater than R::BITS makes the program invalid, and will likely cause either a crash or incorrect memory access.

Construction

This type can only be publicly constructed through BitIdx::span.

Implementations

impl<R> BitTail<R> where
    R: BitRegister
[src]

pub const LAST: Self[src]

The inclusive maximum tail within an element R.

pub const ZERO: Self[src]

The inclusive minimum tail within an element R.

pub fn new(value: u8) -> Option<Self>[src]

Wraps a counter value as a known-good tail of an R register.

Parameters

  • value: The counter value to mark as a tail. This must be not less than Self::ZERO and not more than Self::LAST.

Returns

This returns Some(value) when it is in the valid range 0 .. R::BITS, and None when it is not.

pub fn value(self) -> u8[src]

Removes the tail wrapper, leaving the internal counter.

pub fn range_from(
    from: BitIdx<R>
) -> impl Iterator<Item = Self> + DoubleEndedIterator + ExactSizeIterator + FusedIterator
[src]

Iterates over all tail indices at and after an inclusive starting point.

Because implementation details of the range type family, including the RangeBounds trait, are not yet stable, and heterogenous ranges are not yet supported, this must be an opaque iterator rather than a direct Range<BitTail<R>>.

Parameters

  • from: The inclusive low bound of the range. This will be the first tail produced by the iterator.

Returns

An opaque iterator that is equivalent to the range from ..= Self::LAST.

Trait Implementations

impl<R> Binary for BitTail<R> where
    R: BitRegister
[src]

impl<R: Clone> Clone for BitTail<R> where
    R: BitRegister
[src]

impl<R: Copy> Copy for BitTail<R> where
    R: BitRegister
[src]

impl<R> Debug for BitTail<R> where
    R: BitRegister
[src]

impl<R: Default> Default for BitTail<R> where
    R: BitRegister
[src]

impl<R> Display for BitTail<R> where
    R: BitRegister
[src]

impl<R: Eq> Eq for BitTail<R> where
    R: BitRegister
[src]

impl<R: Hash> Hash for BitTail<R> where
    R: BitRegister
[src]

impl<R: Ord> Ord for BitTail<R> where
    R: BitRegister
[src]

impl<R: PartialEq> PartialEq<BitTail<R>> for BitTail<R> where
    R: BitRegister
[src]

impl<R: PartialOrd> PartialOrd<BitTail<R>> for BitTail<R> where
    R: BitRegister
[src]

impl<R> StructuralEq for BitTail<R> where
    R: BitRegister
[src]

impl<R> StructuralPartialEq for BitTail<R> where
    R: BitRegister
[src]

Auto Trait Implementations

impl<R> RefUnwindSafe for BitTail<R> where
    R: RefUnwindSafe

impl<R> Send for BitTail<R>

impl<R> Sync for BitTail<R>

impl<R> Unpin for BitTail<R>

impl<R> UnwindSafe for BitTail<R> where
    R: 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> ToString for T where
    T: Display + ?Sized
[src]

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.