Struct nibble::array::NibArrayVec
[−]
[src]
pub struct NibArrayVec<A: Array<Item = u4x2>> { /* fields omitted */ }
An ArrayVec
of nibbles.
Methods
impl<A: Array<Item = u4x2>> NibArrayVec<A>
[src]
fn from_ascii(s: &[u8]) -> Result<Self, ParseNibbleError>
[src]
Converts an ASCII hex string into a nibble vector.
fn from_str(s: &str) -> Result<Self, ParseNibbleError>
[src]
Converts a hex string into a nibble vector.
impl<A: Array<Item = u4x2>> NibArrayVec<A>
[src]
fn new() -> Self
[src]
Creates an empty NibArrayVec
.
fn len(&self) -> usize
[src]
Number of nibbles in the vector.
fn is_empty(&self) -> bool
[src]
Whether the vector is empty.
fn capacity(&self) -> usize
[src]
How many nibbles can be stored in the vector.
fn is_full(&self) -> bool
[src]
Whether the vector is full.
fn push<T: u4>(&mut self, nib: T)
[src]
fn try_push<T: u4>(&mut self, nib: T) -> Result<(), CapacityError<T>>
[src]
Pushes a nibble onto the vector if possible.
unsafe fn push_unchecked<T: u4>(&mut self, nib: T)
[src]
Pushes a nibble onto the vector without checking if it's full.
fn insert<T: u4>(&mut self, index: usize, nib: T)
[src]
Inserts a nibble into the vector at the given index.
fn try_insert<T: u4>(
&mut self,
index: usize,
nib: T
) -> Result<(), CapacityError<T>>
[src]
&mut self,
index: usize,
nib: T
) -> Result<(), CapacityError<T>>
Inserts a nibble into the vector at the given index.
fn remove<T: u4>(&mut self, index: usize) -> T
[src]
Removes a nibble from the vector at the given index.
fn pop_at<T: u4>(&mut self, index: usize) -> Option<T>
[src]
Removes a nibble from the vector at the given index, converting it to a high-order nibble.
fn pop<T: u4>(&mut self) -> Option<T>
[src]
Removes a nibble from the vector, converting it to a high-order nibble.
fn clear(&mut self)
[src]
Clears the vector, removing all nibbles.
fn dispose(self)
[src]
Disposes of the vector.
fn into_odd_array(self) -> Result<NibArrayOdd<A>, Self>
[src]
Converts the vector into an odd array, if it's full to one less than capacity.
fn into_even_array(self) -> Result<NibArrayEven<A>, Self>
[src]
Converts the vector into an even array, if it's full to capacity.
fn as_slice(&self) -> NibSliceAligned
[src]
Intreprets this array as a slice.
fn as_mut_slice(&mut self) -> NibSliceAlignedMut
[src]
Intreprets this array as a mutable slice.
Trait Implementations
impl<A: Array<Item = u4x2>, Rhs: ?Sized + NibSliceExt> PartialEq<Rhs> for NibArrayVec<A>
[src]
fn eq(&self, rhs: &Rhs) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests for !=
.
impl<A: Array<Item = u4x2>, Rhs: ?Sized + NibSliceExt> PartialOrd<Rhs> for NibArrayVec<A>
[src]
fn partial_cmp(&self, rhs: &Rhs) -> Option<Ordering>
[src]
This method returns an ordering between self
and other
values if one exists. Read more
fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests less than (for self
and other
) and is used by the <
operator. Read more
fn le(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests greater than or equal to (for self
and other
) and is used by the >=
operator. Read more
impl<A: Array<Item = u4x2>> Hash for NibArrayVec<A>
[src]
fn hash<H: Hasher>(&self, state: &mut H)
[src]
Feeds this value into the given [Hasher
]. Read more
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
Feeds a slice of this type into the given [Hasher
]. Read more
impl<A: Array<Item = u4x2>> Eq for NibArrayVec<A>
[src]
impl<A: Array<Item = u4x2>> Ord for NibArrayVec<A>
[src]
fn cmp(&self, rhs: &NibArrayVec<A>) -> Ordering
[src]
This method returns an Ordering
between self
and other
. Read more
fn max(self, other: Self) -> Self
1.22.0[src]
Compares and returns the maximum of two values. Read more
fn min(self, other: Self) -> Self
1.22.0[src]
Compares and returns the minimum of two values. Read more
impl<A: Array<Item = u4x2>> Binary for NibArrayVec<A>
[src]
impl<A: Array<Item = u4x2>> LowerHex for NibArrayVec<A>
[src]
impl<A: Array<Item = u4x2>> UpperHex for NibArrayVec<A>
[src]
impl<A: Array<Item = u4x2>> Debug for NibArrayVec<A>
[src]
impl<A: Array<Item = u4x2>> FromStr for NibArrayVec<A>
[src]
type Err = ParseNibbleError
The associated error which can be returned from parsing.
fn from_str(s: &str) -> Result<Self, ParseNibbleError>
[src]
Parses a string s
to return a value of this type. Read more
impl<A: Clone + Array<Item = u4x2>> Clone for NibArrayVec<A>
[src]
fn clone(&self) -> NibArrayVec<A>
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl<A: Array<Item = u4x2>> Default for NibArrayVec<A>
[src]
impl<A: Array<Item = u4x2>, T: u4> FromIterator<T> for NibArrayVec<A>
[src]
fn from_iter<I: IntoIterator<Item = T>>(iter: I) -> Self
[src]
Creates a value from an iterator. Read more
impl<'a, A: Array<Item = u4x2>> FromIterator<&'a u4> for NibArrayVec<A>
[src]
fn from_iter<I: IntoIterator<Item = &'a u4>>(iter: I) -> Self
[src]
Creates a value from an iterator. Read more
impl<A: Array<Item = u4x2>> FromIterator<u4x2> for NibArrayVec<A>
[src]
fn from_iter<I: IntoIterator<Item = u4x2>>(iter: I) -> Self
[src]
Creates a value from an iterator. Read more
impl<A: Array<Item = u4x2>, T: u4> Extend<T> for NibArrayVec<A>
[src]
fn extend<I: IntoIterator<Item = T>>(&mut self, iter: I)
[src]
Extends a collection with the contents of an iterator. Read more
impl<'a, A: Array<Item = u4x2>> Extend<&'a u4> for NibArrayVec<A>
[src]
fn extend<I: IntoIterator<Item = &'a u4>>(&mut self, iter: I)
[src]
Extends a collection with the contents of an iterator. Read more
impl<A: Array<Item = u4x2>> Extend<u4x2> for NibArrayVec<A>
[src]
fn extend<I: IntoIterator<Item = u4x2>>(&mut self, iter: I)
[src]
Extends a collection with the contents of an iterator. Read more
impl<A: Array<Item = u4x2>> NibSliceExt for NibArrayVec<A>
[src]
fn nibble_pairs(&self) -> NibblePairs
[src]
Iterator over the nibble pairs in this slice. Read more
fn nibbles(&self) -> Nibbles
[src]
Iterator over nibbles in a slice.
fn decompose(&self) -> (Option<&u4lo>, &[u4x2], Option<&u4hi>)
[src]
Decomposes this slice into its parts.
fn get(&self, idx: usize) -> &u4
[src]
Gets a nibble at the given index.
fn len(&self) -> usize
[src]
Gets the length of the slice.
fn is_empty(&self) -> bool
[src]
Checks if the slice is empty.
fn into_generic(&self) -> NibSlice
[src]
Converts this slice into a NibSlice
.
fn is_aligned(&self) -> bool
[src]
Checks whether this slice is aligned to a byte boundary.
fn is_even(&self) -> bool
[src]
Checks whether this slice has an even number of nibbles.
fn is_odd(&self) -> bool
[src]
Checks whether this slice has an odd number of nibbles.
impl<A: Array<Item = u4x2>> NibSliceMutExt for NibArrayVec<A>
[src]
fn nibble_pairs_mut(&mut self) -> NibblePairsMut
[src]
Mutable iterator over the nibble pairs in this slice. Read more
fn nibbles_mut(&mut self) -> NibblesMut
[src]
Mutable iterator over nibbles in a slice.
fn decompose_mut(
&mut self
) -> (Option<&U4LoCell>, &mut [u4x2], Option<&U4HiCell>)
[src]
&mut self
) -> (Option<&U4LoCell>, &mut [u4x2], Option<&U4HiCell>)
Mutably decomposes this slice into its parts.
fn get_mut(&mut self, idx: usize) -> &U4Cell
[src]
Mutably gets a nibble at the given index.
fn into_generic_mut(&mut self) -> NibSliceMut
[src]
Converts this slice into a NibSliceMut
.