Struct bio::data_structures::bitenc::BitEnc
source · pub struct BitEnc { /* private fields */ }
Expand description
A sequence of bitencoded values.
Implementations
sourceimpl BitEnc
impl BitEnc
sourcepub fn new(width: usize) -> Self
pub fn new(width: usize) -> Self
Create a new instance with a given encoding width (e.g. width=2 for using two bits per value).
sourcepub fn with_capacity(width: usize, n: usize) -> Self
pub fn with_capacity(width: usize, n: usize) -> Self
Create a new instance with a given capacity and encoding width (e.g. width=2 for using two bits per value).
sourcepub fn push_values(&mut self, n: usize, value: u8)
pub fn push_values(&mut self, n: usize, value: u8)
Append n
times the given value.
sourcepub fn iter(&self) -> BitEncIter<'_> ⓘ
pub fn iter(&self) -> BitEncIter<'_> ⓘ
Iterate over stored values (values will be unpacked into bytes).
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
Trait Implementations
sourceimpl<'de> Deserialize<'de> for BitEnc
impl<'de> Deserialize<'de> for BitEnc
sourcefn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations
impl RefUnwindSafe for BitEnc
impl Send for BitEnc
impl Sync for BitEnc
impl Unpin for BitEnc
impl UnwindSafe for BitEnc
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more