pub struct BitLengthString<W: FixedBitString> { /* private fields */ }
Available on crate feature
fixed
only.Expand description
Extend a
FixedBitString
to a
BitString
by also storing a
length.
Implementations§
Source§impl<W: FixedBitString> BitLengthString<W>
impl<W: FixedBitString> BitLengthString<W>
Sourcepub fn new(bits: W, len: usize) -> Self
pub fn new(bits: W, len: usize) -> Self
Create new dynamic-length bit string from fixed bit string and a length.
The bits in bits
after len
bits are set to false.
§Panics
Panics if len > W::len()
.
Sourcepub fn contains(&self, bits: &W) -> bool
pub fn contains(&self, bits: &W) -> bool
check whether another bit string bits
is prefixed by self
Sourcepub fn len(&self) -> usize
pub fn len(&self) -> usize
length of bit string (same as
BitString::len()
)
Trait Implementations§
Source§impl<W: FixedBitString> BitString for BitLengthString<W>
impl<W: FixedBitString> BitString for BitLengthString<W>
Length of the longest shared prefix of two bit strings.
Longest shared prefix of two bit strings.
Source§fn subset_cmp(&self, other: &Self) -> Option<Ordering>
fn subset_cmp(&self, other: &Self) -> Option<Ordering>
Partial ordering on bit strings. Read more
Source§fn lexicographic_cmp(&self, other: &Self) -> Ordering
fn lexicographic_cmp(&self, other: &Self) -> Ordering
Lexicographic ordering on bit strings. Read more
Source§impl<W: Clone + FixedBitString> Clone for BitLengthString<W>
impl<W: Clone + FixedBitString> Clone for BitLengthString<W>
Source§fn clone(&self) -> BitLengthString<W>
fn clone(&self) -> BitLengthString<W>
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl<W: Debug + FixedBitString> Debug for BitLengthString<W>
impl<W: Debug + FixedBitString> Debug for BitLengthString<W>
Source§impl<W: FixedBitString> Default for BitLengthString<W>
impl<W: FixedBitString> Default for BitLengthString<W>
Source§impl<W: Hash + FixedBitString> Hash for BitLengthString<W>
impl<W: Hash + FixedBitString> Hash for BitLengthString<W>
Source§impl<W: FixedBitString> Ord for BitLengthString<W>
impl<W: FixedBitString> Ord for BitLengthString<W>
Source§impl<W: FixedBitString> PartialEq for BitLengthString<W>
impl<W: FixedBitString> PartialEq for BitLengthString<W>
Source§impl<W: FixedBitString> PartialOrd for BitLengthString<W>
impl<W: FixedBitString> PartialOrd for BitLengthString<W>
impl<W: FixedBitString> Eq for BitLengthString<W>
Auto Trait Implementations§
impl<W> Freeze for BitLengthString<W>where
W: Freeze,
impl<W> RefUnwindSafe for BitLengthString<W>where
W: RefUnwindSafe,
impl<W> Send for BitLengthString<W>where
W: Send,
impl<W> Sync for BitLengthString<W>where
W: Sync,
impl<W> Unpin for BitLengthString<W>where
W: Unpin,
impl<W> UnwindSafe for BitLengthString<W>where
W: 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