[−][src]Struct multiproof_rs::keys::binary_key::BinaryKey
Represents a key whose basic unit is the bit. This is meant to be used at the key in binary trees.
Bits are stored inside an array of bytes, and are read left to right. The structure also contains the start and end offset of the bit field.
Example structure
The following code will create a bit field with 6 bits spread over two integers.
use multiproof_rs::keys::BinaryKey; let bitkey = BinaryKey::new(vec![0x55; 2], 3, 6);
The internal representation is therefore:
byte # | 1 2
bit # | 76543210 76543210
----------+------------------
bit value | 01010101 01010101
offsets | ^ ^
| start end
Methods
impl BinaryKey
[src]
Trait Implementations
impl Clone for BinaryKey
[src]
impl Debug for BinaryKey
[src]
impl<'_> From<&'_ [u8]> for BinaryKey
[src]
impl From<Vec<u8>> for BinaryKey
[src]
impl Index<usize> for BinaryKey
[src]
impl Key<u8> for BinaryKey
[src]
impl PartialEq<BinaryKey> for BinaryKey
[src]
impl StructuralPartialEq for BinaryKey
[src]
Auto Trait Implementations
impl RefUnwindSafe for BinaryKey
impl Send for BinaryKey
impl Sync for BinaryKey
impl Unpin for BinaryKey
impl UnwindSafe for BinaryKey
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,