pub struct Bits<'a> {
pub path: &'a [u8],
pub range: Range<BitsLen>,
}
Expand description
BitVec
implementation based on bytes slice.
Fields§
§path: &'a [u8]
§range: Range<BitsLen>
Implementations§
source§impl<'a> Bits<'a>
impl<'a> Bits<'a>
pub fn new(bytes: &'a [u8]) -> Self
sourcepub fn from_bytes(bytes: &'a [u8]) -> Self
pub fn from_bytes(bytes: &'a [u8]) -> Self
Construct Bits
instance by deserializing bytes slice.
pub fn len(&self) -> BitsLen
pub fn is_empty(&self) -> bool
sourcepub fn shift(&self, n: BitsLen, tail: bool) -> Self
pub fn shift(&self, n: BitsLen, tail: bool) -> Self
Get the resulting Bits
when shifted with the given size.
sourcepub fn len_common_bits(a: &Self, b: &Self) -> BitsLen
pub fn len_common_bits(a: &Self, b: &Self) -> BitsLen
Get length of the longest common prefix bits for the given two Bits
.
Trait Implementations§
source§impl<'a> PartialEq<Bits<'a>> for Bits<'a>
impl<'a> PartialEq<Bits<'a>> for Bits<'a>
impl<'a> StructuralPartialEq for Bits<'a>
Auto Trait Implementations§
impl<'a> RefUnwindSafe for Bits<'a>
impl<'a> Send for Bits<'a>
impl<'a> Sync for Bits<'a>
impl<'a> Unpin for Bits<'a>
impl<'a> UnwindSafe for Bits<'a>
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