[][src]Struct sparse_merkle_tree::h256::H256

pub struct H256(_);

Represent 256 bits

Implementations

impl H256[src]

pub const fn zero() -> Self[src]

pub fn is_zero(&self) -> bool[src]

pub fn get_bit(&self, i: u8) -> bool[src]

pub fn set_bit(&mut self, i: u8)[src]

pub fn clear_bit(&mut self, i: u8)[src]

pub fn as_slice(&self) -> &[u8][src]

pub fn fork_height(&self, key: &H256) -> u8[src]

Treat H256 as a path in a tree fork height is the number of common bits(from heigher to lower: 255..=0) of two H256

pub fn parent_path(&self, height: u8) -> Self[src]

Treat H256 as a path in a tree return parent_path of self

pub fn copy_bits(&self, range: impl RangeBounds<u8>) -> Self[src]

Copy bits and return a new H256

Trait Implementations

impl Clone for H256[src]

impl Copy for H256[src]

impl Debug for H256[src]

impl Default for H256[src]

impl Eq for H256[src]

impl From<[u8; 32]> for H256[src]

impl Hash for H256[src]

impl Into<[u8; 32]> for H256[src]

impl Ord for H256[src]

impl PartialEq<H256> for H256[src]

impl PartialOrd<H256> for H256[src]

impl StructuralEq for H256[src]

impl StructuralPartialEq for H256[src]

impl Value for H256[src]

Auto Trait Implementations

impl RefUnwindSafe for H256

impl Send for H256

impl Sync for H256

impl Unpin for H256

impl UnwindSafe for H256

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.