[][src]Struct bitvec::indices::BitIdx

pub struct BitIdx<T> where
    T: BitStore
{ /* fields omitted */ }

Indicates a semantic index of a bit within a memory element.

This type is consumed by BitOrder implementors, which use it to produce a concrete bit position inside an element.

BitIdx is a semantic counter which has a defined, constant, and predictable ordering. Values of BitIdx refer strictly to an abstract ordering, and not to any actual bit positions within a memory element, so BitIdx::<T>(0) is always the first bit counted within an element, but is not required to be the most or least significant bits, or any other particular bits. Which specific bit is referred by a BitIdx value is governed by implementors of BitOrder.

Type Parameters

  • T: The memory element type controlled by this index.

Methods

impl<T> BitIdx<T> where
    T: BitStore
[src]

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

Wraps a counter value as a known-good index of the T element type.

Parameters

  • idx: A semantic index within a T memory element.

Returns

If idx is within the range 0 .. T::BITS, then this returns the index value wrapped in the index type; if idx exceeds this range, then this returns None.

Trait Implementations

impl<T: Clone> Clone for BitIdx<T> where
    T: BitStore
[src]

impl<T: Copy> Copy for BitIdx<T> where
    T: BitStore
[src]

impl<T: Debug> Debug for BitIdx<T> where
    T: BitStore
[src]

impl<T: Default> Default for BitIdx<T> where
    T: BitStore
[src]

impl<T> Deref for BitIdx<T> where
    T: BitStore
[src]

type Target = u8

The resulting type after dereferencing.

impl<T: Eq> Eq for BitIdx<T> where
    T: BitStore
[src]

impl<T: Hash> Hash for BitIdx<T> where
    T: BitStore
[src]

impl<T: Ord> Ord for BitIdx<T> where
    T: BitStore
[src]

impl<T: PartialEq> PartialEq<BitIdx<T>> for BitIdx<T> where
    T: BitStore
[src]

impl<T: PartialOrd> PartialOrd<BitIdx<T>> for BitIdx<T> where
    T: BitStore
[src]

impl<T> StructuralEq for BitIdx<T> where
    T: BitStore
[src]

impl<T> StructuralPartialEq for BitIdx<T> where
    T: BitStore
[src]

impl<T> TryFrom<u8> for BitIdx<T> where
    T: BitStore
[src]

type Error = &'static str

The type returned in the event of a conversion error.

Auto Trait Implementations

impl<T> RefUnwindSafe for BitIdx<T> where
    T: RefUnwindSafe

impl<T> Send for BitIdx<T>

impl<T> Sync for BitIdx<T>

impl<T> Unpin for BitIdx<T> where
    T: Unpin

impl<T> UnwindSafe for BitIdx<T> where
    T: 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> From<T> for T[src]

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

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

type Owned = T

The resulting type after obtaining ownership.

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.