pub struct Bitvector<const L: u32>(/* private fields */);
Expand description
Bitvector without signedness information.
The number of bits is specified in the generic parameter L.
Bitvectors support bitwise operations and wrapping-arithmetic operations.
Only operations where the behaviour of signed and unsigned numbers match are implemented.
For others, conversion into Unsigned
or Signed
is necessary.
Bit-extension is not possible directly, as signed and unsigned bitvectors are extended differently.
Implementations§
Trait Implementations§
Source§impl<const L: u32> Shl for Bitvector<L>
impl<const L: u32> Shl for Bitvector<L>
Source§fn shl(self, rhs: Bitvector<L>) -> Self::Output
fn shl(self, rhs: Bitvector<L>) -> Self::Output
Performs a left shift.
Unlike a right shift, where the behaviour is dependent on signedness, the left shift has the same behaviour: shifted-out bits on the left are discarded and zeros are shifted in on the right.
The right-hand side operand is interpreted as unsigned and if it
is equal or greater to the bit-width, the result is all-zeros,
as in Rust unbounded_shl
. It is planned to restrict the bit-width
in the future so that this edge case can never occur.
impl<const L: u32> Copy for Bitvector<L>
impl<const L: u32> Eq for Bitvector<L>
impl<const L: u32> StructuralPartialEq for Bitvector<L>
Auto Trait Implementations§
impl<const L: u32> Freeze for Bitvector<L>
impl<const L: u32> RefUnwindSafe for Bitvector<L>
impl<const L: u32> Send for Bitvector<L>
impl<const L: u32> Sync for Bitvector<L>
impl<const L: u32> Unpin for Bitvector<L>
impl<const L: u32> UnwindSafe for Bitvector<L>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.