Struct ethcore_util::nibblevec::NibbleVec
[−]
[src]
pub struct NibbleVec { /* fields omitted */ }
Owning, nibble-oriented byte vector. Counterpart to NibbleSlice
.
Methods
impl NibbleVec
[src]
fn new() -> Self
Make a new NibbleVec
fn len(&self) -> usize
Length of the NibbleVec
fn is_empty(&self) -> bool
Retrurns true if NibbleVec
has zero length
fn at(&self, idx: usize) -> u8
Try to get the nibble at the given offset.
fn push(&mut self, nibble: u8)
Push a nibble onto the NibbleVec
. Ignores the high 4 bits.
fn pop(&mut self) -> Option<u8>
Try to pop a nibble off the NibbleVec
. Fails if len == 0.
fn as_nibbleslice(&self) -> Option<NibbleSlice>
Try to treat this NibbleVec
as a NibbleSlice
. Works only if len is even.
fn inner(&self) -> &[u8]
Get the underlying byte slice.
Trait Implementations
impl Clone for NibbleVec
[src]
fn clone(&self) -> NibbleVec
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more
impl PartialEq for NibbleVec
[src]
fn eq(&self, __arg_0: &NibbleVec) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &NibbleVec) -> bool
This method tests for !=
.
impl Eq for NibbleVec
[src]
impl Debug for NibbleVec
[src]
impl Default for NibbleVec
[src]
impl<'a> From<NibbleSlice<'a>> for NibbleVec
[src]
fn from(s: NibbleSlice<'a>) -> Self
Performs the conversion.