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>
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.6.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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)