Struct bitmap32::LE

source ·
#[repr(transparent)]
pub struct LE<B: BitBlock>(pub B);
Expand description

BitBlocks that use Little Endian order instead of Big Endian Order.

Example

let map = BitMap::from_raw_le([0b00000001u8, 0b01000000]);

assert_eq!(map.test(0), Some(true));
assert_eq!(map.test(9), Some(false));
assert_eq!(map.test(14), Some(true));
assert_eq!(map.test(7), Some(false));

Tuple Fields§

§0: B

Trait Implementations§

source§

impl<B: BitBlock> BitAnd<LE<B>> for LE<B>

§

type Output = LE<<B as BitAnd<B>>::Output>

The resulting type after applying the & operator.
source§

fn bitand(self, rhs: Self) -> Self::Output

Performs the & operation. Read more
source§

impl<B: BitBlock> BitAndAssign<LE<B>> for LE<B>

source§

fn bitand_assign(&mut self, rhs: Self)

Performs the &= operation. Read more
source§

impl BitBlock for LE<u128>

source§

const ZERO: Self = _

source§

const UPSTREAM_ONE: Self = _

As of now, this value is not 1 for unsigned integers UPSTREAM_ONE.wrapping_shift_upstream(1) should be 0. For example, for u8, this value is 0x80 (0b10000000).
source§

const BITS: usize = 128usize

Represents the number of bits in a block. It is generally a good idea for this number to be a power of two.
source§

fn wrapping_shift_downstream(self, n: usize) -> Self

Shifts self n bits in the indexing direction.
source§

fn wrapping_shift_upstream(self, n: usize) -> Self

Shifts self n bits against the indexing direction.
source§

fn leading_zeros(self) -> usize

Gets the leading zeros in the indexing direction.
source§

fn leading_ones(self) -> usize

Gets the leading ones in the indexing direction.
source§

fn get_block_index(idx: usize) -> usize

Returns the index of the block holding the bit at the specified location in a collection (eg. for a u8, get_block_index(9) == 2).
source§

fn bit_index_from_block_index(idx: usize) -> usize

Returns the index of the first bit in the block at idx..
source§

fn wrapping_test_bit(self, idx: usize) -> bool

Returns true if the bit at idx is 1.
source§

fn wrapping_with_bit(self, idx: usize) -> Self

Returns self with the bit at idx set to 1.
source§

fn wrapping_without_bit(self, idx: usize) -> Self

Returns self with the bit at idx set to 0.
source§

fn ones_mask(position: usize, length: NonZeroUsize) -> Self

Returns a bit mask of ones at position (wrapped) with a length of length (saturated). Read more
source§

impl BitBlock for LE<u16>

source§

const ZERO: Self = _

source§

const UPSTREAM_ONE: Self = _

As of now, this value is not 1 for unsigned integers UPSTREAM_ONE.wrapping_shift_upstream(1) should be 0. For example, for u8, this value is 0x80 (0b10000000).
source§

const BITS: usize = 16usize

Represents the number of bits in a block. It is generally a good idea for this number to be a power of two.
source§

fn wrapping_shift_downstream(self, n: usize) -> Self

Shifts self n bits in the indexing direction.
source§

fn wrapping_shift_upstream(self, n: usize) -> Self

Shifts self n bits against the indexing direction.
source§

fn leading_zeros(self) -> usize

Gets the leading zeros in the indexing direction.
source§

fn leading_ones(self) -> usize

Gets the leading ones in the indexing direction.
source§

fn get_block_index(idx: usize) -> usize

Returns the index of the block holding the bit at the specified location in a collection (eg. for a u8, get_block_index(9) == 2).
source§

fn bit_index_from_block_index(idx: usize) -> usize

Returns the index of the first bit in the block at idx..
source§

fn wrapping_test_bit(self, idx: usize) -> bool

Returns true if the bit at idx is 1.
source§

fn wrapping_with_bit(self, idx: usize) -> Self

Returns self with the bit at idx set to 1.
source§

fn wrapping_without_bit(self, idx: usize) -> Self

Returns self with the bit at idx set to 0.
source§

fn ones_mask(position: usize, length: NonZeroUsize) -> Self

Returns a bit mask of ones at position (wrapped) with a length of length (saturated). Read more
source§

impl BitBlock for LE<u32>

source§

const ZERO: Self = _

source§

const UPSTREAM_ONE: Self = _

As of now, this value is not 1 for unsigned integers UPSTREAM_ONE.wrapping_shift_upstream(1) should be 0. For example, for u8, this value is 0x80 (0b10000000).
source§

const BITS: usize = 32usize

Represents the number of bits in a block. It is generally a good idea for this number to be a power of two.
source§

fn wrapping_shift_downstream(self, n: usize) -> Self

Shifts self n bits in the indexing direction.
source§

fn wrapping_shift_upstream(self, n: usize) -> Self

Shifts self n bits against the indexing direction.
source§

fn leading_zeros(self) -> usize

Gets the leading zeros in the indexing direction.
source§

fn leading_ones(self) -> usize

Gets the leading ones in the indexing direction.
source§

fn get_block_index(idx: usize) -> usize

Returns the index of the block holding the bit at the specified location in a collection (eg. for a u8, get_block_index(9) == 2).
source§

fn bit_index_from_block_index(idx: usize) -> usize

Returns the index of the first bit in the block at idx..
source§

fn wrapping_test_bit(self, idx: usize) -> bool

Returns true if the bit at idx is 1.
source§

fn wrapping_with_bit(self, idx: usize) -> Self

Returns self with the bit at idx set to 1.
source§

fn wrapping_without_bit(self, idx: usize) -> Self

Returns self with the bit at idx set to 0.
source§

fn ones_mask(position: usize, length: NonZeroUsize) -> Self

Returns a bit mask of ones at position (wrapped) with a length of length (saturated). Read more
source§

impl BitBlock for LE<u64>

source§

const ZERO: Self = _

source§

const UPSTREAM_ONE: Self = _

As of now, this value is not 1 for unsigned integers UPSTREAM_ONE.wrapping_shift_upstream(1) should be 0. For example, for u8, this value is 0x80 (0b10000000).
source§

const BITS: usize = 64usize

Represents the number of bits in a block. It is generally a good idea for this number to be a power of two.
source§

fn wrapping_shift_downstream(self, n: usize) -> Self

Shifts self n bits in the indexing direction.
source§

fn wrapping_shift_upstream(self, n: usize) -> Self

Shifts self n bits against the indexing direction.
source§

fn leading_zeros(self) -> usize

Gets the leading zeros in the indexing direction.
source§

fn leading_ones(self) -> usize

Gets the leading ones in the indexing direction.
source§

fn get_block_index(idx: usize) -> usize

Returns the index of the block holding the bit at the specified location in a collection (eg. for a u8, get_block_index(9) == 2).
source§

fn bit_index_from_block_index(idx: usize) -> usize

Returns the index of the first bit in the block at idx..
source§

fn wrapping_test_bit(self, idx: usize) -> bool

Returns true if the bit at idx is 1.
source§

fn wrapping_with_bit(self, idx: usize) -> Self

Returns self with the bit at idx set to 1.
source§

fn wrapping_without_bit(self, idx: usize) -> Self

Returns self with the bit at idx set to 0.
source§

fn ones_mask(position: usize, length: NonZeroUsize) -> Self

Returns a bit mask of ones at position (wrapped) with a length of length (saturated). Read more
source§

impl BitBlock for LE<u8>

source§

const ZERO: Self = _

source§

const UPSTREAM_ONE: Self = _

As of now, this value is not 1 for unsigned integers UPSTREAM_ONE.wrapping_shift_upstream(1) should be 0. For example, for u8, this value is 0x80 (0b10000000).
source§

const BITS: usize = 8usize

Represents the number of bits in a block. It is generally a good idea for this number to be a power of two.
source§

fn wrapping_shift_downstream(self, n: usize) -> Self

Shifts self n bits in the indexing direction.
source§

fn wrapping_shift_upstream(self, n: usize) -> Self

Shifts self n bits against the indexing direction.
source§

fn leading_zeros(self) -> usize

Gets the leading zeros in the indexing direction.
source§

fn leading_ones(self) -> usize

Gets the leading ones in the indexing direction.
source§

fn get_block_index(idx: usize) -> usize

Returns the index of the block holding the bit at the specified location in a collection (eg. for a u8, get_block_index(9) == 2).
source§

fn bit_index_from_block_index(idx: usize) -> usize

Returns the index of the first bit in the block at idx..
source§

fn wrapping_test_bit(self, idx: usize) -> bool

Returns true if the bit at idx is 1.
source§

fn wrapping_with_bit(self, idx: usize) -> Self

Returns self with the bit at idx set to 1.
source§

fn wrapping_without_bit(self, idx: usize) -> Self

Returns self with the bit at idx set to 0.
source§

fn ones_mask(position: usize, length: NonZeroUsize) -> Self

Returns a bit mask of ones at position (wrapped) with a length of length (saturated). Read more
source§

impl<B: BitBlock> BitOr<LE<B>> for LE<B>

§

type Output = LE<<B as BitOr<B>>::Output>

The resulting type after applying the | operator.
source§

fn bitor(self, rhs: Self) -> Self::Output

Performs the | operation. Read more
source§

impl<B: BitBlock> BitOrAssign<LE<B>> for LE<B>

source§

fn bitor_assign(&mut self, rhs: Self)

Performs the |= operation. Read more
source§

impl<B: Clone + BitBlock> Clone for LE<B>

source§

fn clone(&self) -> LE<B>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<B: Debug + BitBlock> Debug for LE<B>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<B: Hash + BitBlock> Hash for LE<B>

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl<B: BitBlock> Not for LE<B>

§

type Output = LE<<B as Not>::Output>

The resulting type after applying the ! operator.
source§

fn not(self) -> Self::Output

Performs the unary ! operation. Read more
source§

impl<B: Ord + BitBlock> Ord for LE<B>

source§

fn cmp(&self, other: &LE<B>) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Selfwhere Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Selfwhere Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Selfwhere Self: Sized + PartialOrd<Self>,

Restrict a value to a certain interval. Read more
source§

impl<B: PartialEq + BitBlock> PartialEq<LE<B>> for LE<B>

source§

fn eq(&self, other: &LE<B>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<B: PartialOrd + BitBlock> PartialOrd<LE<B>> for LE<B>

source§

fn partial_cmp(&self, other: &LE<B>) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl<B: Copy + BitBlock> Copy for LE<B>

source§

impl<B: Eq + BitBlock> Eq for LE<B>

source§

impl<B: BitBlock> StructuralEq for LE<B>

source§

impl<B: BitBlock> StructuralPartialEq for LE<B>

Auto Trait Implementations§

§

impl<B> RefUnwindSafe for LE<B>where B: RefUnwindSafe,

§

impl<B> Send for LE<B>where B: Send,

§

impl<B> Sync for LE<B>where B: Sync,

§

impl<B> Unpin for LE<B>where B: Unpin,

§

impl<B> UnwindSafe for LE<B>where B: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.