Struct bitvec::indices::BitPos [−][src]
Indicates a real electrical index within an element.
This type is produced by BitOrder
implementors, and marks a specific
electrical bit within a memory element, rather than BitIdx
’s semantic bit.
Type Parameters
Implementations
impl<T> BitPos<T> where
T: BitStore,
[src]
T: BitStore,
pub fn new(pos: u8) -> Self
[src]
Produce a new bit position marker at a valid position value.
BitOrder
implementations should prefer this method, but may use
::new_unchecked
if they can guarantee that the range invariant is
upheld.
Parameters
pos
: The bit position value to encode. It must be in the range0 .. T::BITS
.
Panics
This function panics if pos
is greater than or equal to T::BITS
.
pub unsafe fn new_unchecked(pos: u8) -> Self
[src]
Produce a new bit position marker at any position value.
Safety
The caller must ensure that pos
is less than T::BITS
. BitOrder
implementations should prefer ::new
, which panics on range failure.
Parameters
pos
: The bit position value to encode. This must be in the range0 .. T::BITS
.
Returns
pos
wrapped in the BitPos
marker type.
Panics
This function panics if pos
is greater than or equal to T::BITS
, but
only in debug builds. It does not inspect pos
in release builds.
Trait Implementations
impl<T: Clone> Clone for BitPos<T> where
T: BitStore,
[src]
T: BitStore,
impl<T: Copy> Copy for BitPos<T> where
T: BitStore,
[src]
T: BitStore,
impl<T: Debug> Debug for BitPos<T> where
T: BitStore,
[src]
T: BitStore,
impl<T: Default> Default for BitPos<T> where
T: BitStore,
[src]
T: BitStore,
impl<T> Deref for BitPos<T> where
T: BitStore,
[src]
T: BitStore,
impl<T: Eq> Eq for BitPos<T> where
T: BitStore,
[src]
T: BitStore,
impl<T: Hash> Hash for BitPos<T> where
T: BitStore,
[src]
T: BitStore,
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
pub fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl<T: Ord> Ord for BitPos<T> where
T: BitStore,
[src]
T: BitStore,
fn cmp(&self, other: &BitPos<T>) -> Ordering
[src]
#[must_use]pub fn max(self, other: Self) -> Self
1.21.0[src]
#[must_use]pub fn min(self, other: Self) -> Self
1.21.0[src]
#[must_use]pub fn clamp(self, min: Self, max: Self) -> Self
1.50.0[src]
impl<T: PartialEq> PartialEq<BitPos<T>> for BitPos<T> where
T: BitStore,
[src]
T: BitStore,
impl<T: PartialOrd> PartialOrd<BitPos<T>> for BitPos<T> where
T: BitStore,
[src]
T: BitStore,
fn partial_cmp(&self, other: &BitPos<T>) -> Option<Ordering>
[src]
#[must_use]pub fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl<T> StructuralEq for BitPos<T> where
T: BitStore,
[src]
T: BitStore,
impl<T> StructuralPartialEq for BitPos<T> where
T: BitStore,
[src]
T: BitStore,
Auto Trait Implementations
impl<T> RefUnwindSafe for BitPos<T> where
T: RefUnwindSafe,
T: RefUnwindSafe,
impl<T> Send for BitPos<T>
impl<T> Sync for BitPos<T>
impl<T> Unpin for BitPos<T> where
T: Unpin,
T: Unpin,
impl<T> UnwindSafe for BitPos<T> where
T: UnwindSafe,
T: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,