Struct sparse_merkle_tree::h256::H256
source · pub struct H256(_);
Expand description
Represent 256 bits
Implementations
sourceimpl H256
impl H256
pub const fn zero() -> Self
pub fn is_zero(&self) -> bool
pub fn get_bit(&self, i: u8) -> bool
pub fn set_bit(&mut self, i: u8)
pub fn clear_bit(&mut self, i: u8)
pub fn is_right(&self, height: u8) -> bool
pub fn as_slice(&self) -> &[u8] ⓘ
sourcepub fn fork_height(&self, key: &H256) -> u8
pub fn fork_height(&self, key: &H256) -> u8
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
sourcepub fn parent_path(&self, height: u8) -> Self
pub fn parent_path(&self, height: u8) -> Self
Treat H256 as a path in a tree return parent_path of self
Trait Implementations
sourceimpl Ord for H256
impl Ord for H256
1.21.0 · sourcefn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
1.21.0 · sourcefn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
1.50.0 · sourcefn clamp(self, min: Self, max: Self) -> Selfwhere
Self: Sized + PartialOrd<Self>,
fn clamp(self, min: Self, max: Self) -> Selfwhere
Self: Sized + PartialOrd<Self>,
Restrict a value to a certain interval. Read more
sourceimpl PartialOrd<H256> for H256
impl PartialOrd<H256> for H256
sourcefn partial_cmp(&self, other: &Self) -> Option<Ordering>
fn partial_cmp(&self, other: &Self) -> Option<Ordering>
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moreimpl Copy for H256
impl Eq for H256
impl StructuralEq for H256
impl StructuralPartialEq for H256
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
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