pub struct BitSeq<I: BitRepr> { /* private fields */ }Expand description
Implementations§
Source§impl<I: BitRepr> BitSeq<I>
impl<I: BitRepr> BitSeq<I>
pub const MAX_LEN: usize = I::BITS
pub fn new(val: I, len: usize) -> Self
Sourcepub fn new_rev(val: I, len: usize) -> Self
pub fn new_rev(val: I, len: usize) -> Self
Like new, but interprets val as bit-reversed so that
the most-significant bit becomes self[0].
pub fn empty() -> Self
pub fn zeros(len: usize) -> Self
pub fn ones(len: usize) -> Self
pub fn len(&self) -> usize
pub fn val(&self) -> I
Sourcepub fn as_usize(&self) -> usize
pub fn as_usize(&self) -> usize
The packed word as an index. Panics rather than truncating, which a plain as usize
would do once the sequence exceeds usize::BITS.
pub fn is_empty(&self) -> bool
pub fn iter(&self) -> impl Iterator<Item = Bit> + use<I>
pub fn set(&mut self, i: usize, b: Bit)
pub fn set_0(&mut self, i: usize)
pub fn set_1(&mut self, i: usize)
pub fn push(&mut self, b: Bit)
pub fn push_0(&mut self)
pub fn push_1(&mut self)
pub fn append(&mut self, b: BitSeq<I>)
pub fn remove(&mut self, i: usize)
pub fn insert(&mut self, i: usize, b: Bit)
pub fn insert_0(&mut self, i: usize)
pub fn insert_1(&mut self, i: usize)
pub fn edit<F>(&self, f: F) -> Self
pub fn sub(&self, l: usize) -> Self
Trait Implementations§
Source§impl<I: BitRepr> AddAssign for BitSeq<I>
impl<I: BitRepr> AddAssign for BitSeq<I>
Source§fn add_assign(&mut self, rhs: BitSeq<I>)
fn add_assign(&mut self, rhs: BitSeq<I>)
Performs the
+= operation. Read moreSource§impl<I: BitRepr> AddAssign<&Bit> for BitSeq<I>
impl<I: BitRepr> AddAssign<&Bit> for BitSeq<I>
Source§fn add_assign(&mut self, rhs: &Bit)
fn add_assign(&mut self, rhs: &Bit)
Performs the
+= operation. Read moreSource§impl<I: BitRepr> AddAssign<&BitSeq<I>> for BitSeq<I>
impl<I: BitRepr> AddAssign<&BitSeq<I>> for BitSeq<I>
Source§fn add_assign(&mut self, rhs: &Self)
fn add_assign(&mut self, rhs: &Self)
Performs the
+= operation. Read moreSource§impl<I: BitRepr> AddAssign<Bit> for BitSeq<I>
impl<I: BitRepr> AddAssign<Bit> for BitSeq<I>
Source§fn add_assign(&mut self, b: Bit)
fn add_assign(&mut self, b: Bit)
Performs the
+= operation. Read moreimpl<I: Copy + BitRepr> Copy for BitSeq<I>
impl<I: Eq + BitRepr> Eq for BitSeq<I>
Source§impl<I: BitRepr, T> FromIterator<T> for BitSeq<I>
impl<I: BitRepr, T> FromIterator<T> for BitSeq<I>
Source§fn from_iter<Itr: IntoIterator<Item = T>>(iter: Itr) -> Self
fn from_iter<Itr: IntoIterator<Item = T>>(iter: Itr) -> Self
Creates a value from an iterator. Read more
Source§impl<I: BitRepr> Ord for BitSeq<I>
Ordered by len, then weight, then raw val.
impl<I: BitRepr> Ord for BitSeq<I>
Ordered by len, then weight, then raw val.
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl<I: BitRepr> PartialOrd for BitSeq<I>
impl<I: BitRepr> PartialOrd for BitSeq<I>
impl<I: PartialEq + BitRepr> StructuralPartialEq for BitSeq<I>
Auto Trait Implementations§
impl<I> Freeze for BitSeq<I>where
I: Freeze,
impl<I> RefUnwindSafe for BitSeq<I>where
I: RefUnwindSafe,
impl<I> Send for BitSeq<I>
impl<I> Sync for BitSeq<I>
impl<I> Unpin for BitSeq<I>where
I: Unpin,
impl<I> UnsafeUnpin for BitSeq<I>where
I: UnsafeUnpin,
impl<I> UnwindSafe for BitSeq<I>where
I: UnwindSafe,
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
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
Compare self to
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
impl<T> IndexType for T
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more