[][src]Struct numext_fixed_hash_core::H160

pub struct H160(pub [u8; 20]);

Fixed hash type.

Implementations

impl H160[src]

pub const fn repeat_byte(byte: u8) -> Self[src]

Return a new fixed hash where all bytes are set to the given byte.

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

👎 Deprecated since 0.1.5:

Please use the empty function instead

Create a new fixed hash and all bits of it are zeros.

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

👎 Deprecated since 0.1.5:

Please use the is_empty function instead

Test if all bits of a fixed hash are zero.

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

👎 Deprecated since 0.1.5:

Please use the is_full function instead

Test if all bits of a fixed hash are one.

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

Create a new fixed hash and all bits of it are zero.

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

Test if all bits of a fixed hash are zero.

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

Create a new fixed hash and all bits of it are one.

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

Test if all bits of a fixed hash are one.

pub fn covers(&self, hash: &Self) -> bool[src]

Test if all bits set in a hash are also set in self.

pub const fn count_bits() -> u64[src]

Return the count of bits.

pub fn bit(&self, index: usize) -> Option<bool>[src]

Return a specific bit, or return None when overlows.

Order from low to high.

pub fn set_bit(&mut self, index: usize, value: bool) -> bool[src]

Set a specific bit. Return false when overflows.

Order from low to high.

pub fn highest_one(&self) -> Option<usize>[src]

Return the highest bit which is one.

Order from low to high.

pub fn lowest_one(&self) -> Option<usize>[src]

Return the lowest bit which is one.

Order from low to high.

pub const fn count_bytes() -> u64[src]

Return the count of bytes.

pub fn byte(&self, index: usize) -> Option<u8>[src]

Return a specific byte, or return None when overlows.

pub fn set_byte(&mut self, index: usize, byte: u8) -> bool[src]

Set a specific byte. Return false when overflows;

pub fn highest_nonzero_byte(&self) -> Option<usize>[src]

Return the highest byte which is nonzero.

pub fn lowest_nonzero_byte(&self) -> Option<usize>[src]

Return the lowest byte which is nonzero.

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

Get the inner bytes slice of a fixed hash.

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

Get the mutable inner bytes slice of a fixed hash.

pub fn as_fixed_bytes(&self) -> &[u8; 20][src]

Get the inner bytes of a fixed hash.

pub fn as_fixed_bytes_mut(&mut self) -> &mut [u8; 20][src]

Get the mutable inner bytes of a fixed hash.

pub fn into_fixed_bytes(self) -> [u8; 20][src]

Get the inner bytes array of a fixed hash.

pub fn to_vec(&self) -> Vec<u8>[src]

Get a vec of a fixed hash.

pub fn as_ptr(&self) -> *const u8[src]

Get a constant raw pointer to the inner bytes array of a fixed hash.

pub fn as_mut_ptr(&mut self) -> *mut u8[src]

Get a mutable raw pointer to the inner bytes array of a fixed hash.

pub const fn size_of() -> usize[src]

Return the size used by this type in bytes, actually.

This size is greater than or equal to the bytes of this fixed type.

pub fn from_slice(input: &[u8]) -> Result<Self, FixedHashError>[src]

Convert from slice.

pub fn into_slice(&self, output: &mut [u8]) -> Result<(), FixedHashError>[src]

Convert into slice.

pub fn from_hex_str(input: &str) -> Result<Self, FixedHashError>[src]

Convert from a fixed length hexadecimal string.

pub fn from_trimmed_hex_str(input: &str) -> Result<Self, FixedHashError>[src]

Convert from an arbitrary length zero-trimmed hexadecimal string. Fisrt char should not be zero if the input has more than one char.

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

Returns the smallest value that can be represented by this integer type.

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

Returns the largest value that can be represented by this integer type.

pub fn count_ones(&self) -> u32[src]

Returns the number of ones in the binary representation of self.

pub fn count_zeros(&self) -> u32[src]

Returns the number of zeros in the binary representation of self.

pub fn leading_zeros(&self) -> u32[src]

Returns the number of leading zeros in the binary representation of self.

pub fn trailing_zeros(&self) -> u32[src]

Returns the number of trailing zeros in the binary representation of self.

pub fn checked_shl(&self, rhs: u128) -> Option<Self>[src]

Checked shift left. Computes self << rhs, returning None if rhs is larger than or equal to the number of bits in self.

pub fn checked_shr(&self, rhs: u128) -> Option<Self>[src]

Checked shift right. Computes self >> rhs, returning None if rhs is larger than or equal to the number of bits in self.

pub fn overflowing_shl(&self, rhs: u128) -> (Self, bool)[src]

Shifts self left by rhs bits.

Returns a tuple of the shifted version of self along with a boolean indicating whether the shift value was larger than or equal to the number of bits. If the shift value is too large, then value is masked (N-1) where N is the number of bits, and this value is then used to perform the shift.

pub fn overflowing_shr(&self, rhs: u128) -> (Self, bool)[src]

Shifts self right by rhs bits.

Returns a tuple of the shifted version of self along with a boolean indicating whether the shift value was larger than or equal to the number of bits. If the shift value is too large, then value is masked (N-1) where N is the number of bits, and this value is then used to perform the shift.

Trait Implementations

impl AsMut<[u8]> for H160[src]

impl AsRef<[u8]> for H160[src]

impl<'a> BitAnd<&'a H160> for H160[src]

type Output = H160

The resulting type after applying the & operator.

impl<'a, 'b> BitAnd<&'b H160> for &'a H160[src]

type Output = H160

The resulting type after applying the & operator.

impl<'a, Rhs> BitAnd<Rhs> for &'a H160 where
    Rhs: Into<H160>, 
[src]

type Output = H160

The resulting type after applying the & operator.

impl<Rhs> BitAnd<Rhs> for H160 where
    Rhs: Into<H160>, 
[src]

type Output = H160

The resulting type after applying the & operator.

impl<'a> BitAndAssign<&'a H160> for H160[src]

impl<Rhs> BitAndAssign<Rhs> for H160 where
    Rhs: Into<H160>, 
[src]

impl<'a> BitOr<&'a H160> for H160[src]

type Output = H160

The resulting type after applying the | operator.

impl<'a, 'b> BitOr<&'b H160> for &'a H160[src]

type Output = H160

The resulting type after applying the | operator.

impl<'a, Rhs> BitOr<Rhs> for &'a H160 where
    Rhs: Into<H160>, 
[src]

type Output = H160

The resulting type after applying the | operator.

impl<Rhs> BitOr<Rhs> for H160 where
    Rhs: Into<H160>, 
[src]

type Output = H160

The resulting type after applying the | operator.

impl<'a> BitOrAssign<&'a H160> for H160[src]

impl<Rhs> BitOrAssign<Rhs> for H160 where
    Rhs: Into<H160>, 
[src]

impl<'a> BitXor<&'a H160> for H160[src]

type Output = H160

The resulting type after applying the ^ operator.

impl<'a, 'b> BitXor<&'b H160> for &'a H160[src]

type Output = H160

The resulting type after applying the ^ operator.

impl<'a, Rhs> BitXor<Rhs> for &'a H160 where
    Rhs: Into<H160>, 
[src]

type Output = H160

The resulting type after applying the ^ operator.

impl<Rhs> BitXor<Rhs> for H160 where
    Rhs: Into<H160>, 
[src]

type Output = H160

The resulting type after applying the ^ operator.

impl<'a> BitXorAssign<&'a H160> for H160[src]

impl<Rhs> BitXorAssign<Rhs> for H160 where
    Rhs: Into<H160>, 
[src]

impl Clone for H160[src]

impl Debug for H160[src]

impl Default for H160[src]

impl Display for H160[src]

impl Eq for H160[src]

impl<'a> From<&'a [u8; 20]> for H160[src]

impl<'a> From<&'a H160> for U160[src]

impl<'a> From<&'a U160> for H160[src]

impl From<[u8; 20]> for H160[src]

impl From<H160> for [u8; 20][src]

impl From<H160> for U160[src]

impl From<U160> for H160[src]

impl FromStr for H160[src]

type Err = FixedHashError

The associated error which can be returned from parsing.

fn from_str(s: &str) -> Result<Self, Self::Err>[src]

Convert from a hexadecimal string.

impl Hash for H160[src]

impl HashConvert<H1024> for H160[src]

impl HashConvert<H128> for H160[src]

impl HashConvert<H160> for H128[src]

impl HashConvert<H160> for H224[src]

impl HashConvert<H160> for H256[src]

impl HashConvert<H160> for H384[src]

impl HashConvert<H160> for H512[src]

impl HashConvert<H160> for H520[src]

impl HashConvert<H160> for H1024[src]

impl HashConvert<H160> for H2048[src]

impl HashConvert<H160> for H4096[src]

impl HashConvert<H2048> for H160[src]

impl HashConvert<H224> for H160[src]

impl HashConvert<H256> for H160[src]

impl HashConvert<H384> for H160[src]

impl HashConvert<H4096> for H160[src]

impl HashConvert<H512> for H160[src]

impl HashConvert<H520> for H160[src]

impl<Idx> Index<Idx> for H160 where
    Idx: SliceIndex<[u8], Output = [u8]>, 
[src]

type Output = Idx::Output

The returned type after indexing.

impl<Idx> IndexMut<Idx> for H160 where
    Idx: SliceIndex<[u8], Output = [u8]>, 
[src]

impl LowerHex for H160[src]

impl<'a> Not for &'a H160[src]

type Output = H160

The resulting type after applying the ! operator.

impl Not for H160[src]

type Output = H160

The resulting type after applying the ! operator.

impl Ord for H160[src]

impl PartialEq<H160> for H160[src]

impl PartialOrd<H160> for H160[src]

impl<'a, 'b> Shl<&'a i128> for &'b H160[src]

type Output = H160

The resulting type after applying the << operator.

impl<'a> Shl<&'a i128> for H160[src]

type Output = H160

The resulting type after applying the << operator.

impl<'a, 'b> Shl<&'a i16> for &'b H160[src]

type Output = H160

The resulting type after applying the << operator.

impl<'a> Shl<&'a i16> for H160[src]

type Output = H160

The resulting type after applying the << operator.

impl<'a, 'b> Shl<&'a i32> for &'b H160[src]

type Output = H160

The resulting type after applying the << operator.

impl<'a> Shl<&'a i32> for H160[src]

type Output = H160

The resulting type after applying the << operator.

impl<'a, 'b> Shl<&'a i64> for &'b H160[src]

type Output = H160

The resulting type after applying the << operator.

impl<'a> Shl<&'a i64> for H160[src]

type Output = H160

The resulting type after applying the << operator.

impl<'a, 'b> Shl<&'a i8> for &'b H160[src]

type Output = H160

The resulting type after applying the << operator.

impl<'a> Shl<&'a i8> for H160[src]

type Output = H160

The resulting type after applying the << operator.

impl<'a, 'b> Shl<&'a isize> for &'b H160[src]

type Output = H160

The resulting type after applying the << operator.

impl<'a> Shl<&'a isize> for H160[src]

type Output = H160

The resulting type after applying the << operator.

impl<'a, 'b> Shl<&'a u128> for &'b H160[src]

type Output = H160

The resulting type after applying the << operator.

impl<'a> Shl<&'a u128> for H160[src]

type Output = H160

The resulting type after applying the << operator.

impl<'a, 'b> Shl<&'a u16> for &'b H160[src]

type Output = H160

The resulting type after applying the << operator.

impl<'a> Shl<&'a u16> for H160[src]

type Output = H160

The resulting type after applying the << operator.

impl<'a, 'b> Shl<&'a u32> for &'b H160[src]

type Output = H160

The resulting type after applying the << operator.

impl<'a> Shl<&'a u32> for H160[src]

type Output = H160

The resulting type after applying the << operator.

impl<'a, 'b> Shl<&'a u64> for &'b H160[src]

type Output = H160

The resulting type after applying the << operator.

impl<'a> Shl<&'a u64> for H160[src]

type Output = H160

The resulting type after applying the << operator.

impl<'a, 'b> Shl<&'a u8> for &'b H160[src]

type Output = H160

The resulting type after applying the << operator.

impl<'a> Shl<&'a u8> for H160[src]

type Output = H160

The resulting type after applying the << operator.

impl<'a, 'b> Shl<&'a usize> for &'b H160[src]

type Output = H160

The resulting type after applying the << operator.

impl<'a> Shl<&'a usize> for H160[src]

type Output = H160

The resulting type after applying the << operator.

impl<'a> Shl<i128> for &'a H160[src]

type Output = H160

The resulting type after applying the << operator.

impl Shl<i128> for H160[src]

type Output = H160

The resulting type after applying the << operator.

impl<'a> Shl<i16> for &'a H160[src]

type Output = H160

The resulting type after applying the << operator.

impl Shl<i16> for H160[src]

type Output = H160

The resulting type after applying the << operator.

impl<'a> Shl<i32> for &'a H160[src]

type Output = H160

The resulting type after applying the << operator.

impl Shl<i32> for H160[src]

type Output = H160

The resulting type after applying the << operator.

impl<'a> Shl<i64> for &'a H160[src]

type Output = H160

The resulting type after applying the << operator.

impl Shl<i64> for H160[src]

type Output = H160

The resulting type after applying the << operator.

impl<'a> Shl<i8> for &'a H160[src]

type Output = H160

The resulting type after applying the << operator.

impl Shl<i8> for H160[src]

type Output = H160

The resulting type after applying the << operator.

impl<'a> Shl<isize> for &'a H160[src]

type Output = H160

The resulting type after applying the << operator.

impl Shl<isize> for H160[src]

type Output = H160

The resulting type after applying the << operator.

impl<'a> Shl<u128> for &'a H160[src]

type Output = H160

The resulting type after applying the << operator.

impl Shl<u128> for H160[src]

type Output = H160

The resulting type after applying the << operator.

impl<'a> Shl<u16> for &'a H160[src]

type Output = H160

The resulting type after applying the << operator.

impl Shl<u16> for H160[src]

type Output = H160

The resulting type after applying the << operator.

impl<'a> Shl<u32> for &'a H160[src]

type Output = H160

The resulting type after applying the << operator.

impl Shl<u32> for H160[src]

type Output = H160

The resulting type after applying the << operator.

impl<'a> Shl<u64> for &'a H160[src]

type Output = H160

The resulting type after applying the << operator.

impl Shl<u64> for H160[src]

type Output = H160

The resulting type after applying the << operator.

impl<'a> Shl<u8> for &'a H160[src]

type Output = H160

The resulting type after applying the << operator.

impl Shl<u8> for H160[src]

type Output = H160

The resulting type after applying the << operator.

impl<'a> Shl<usize> for &'a H160[src]

type Output = H160

The resulting type after applying the << operator.

impl Shl<usize> for H160[src]

type Output = H160

The resulting type after applying the << operator.

impl<'a> ShlAssign<&'a i128> for H160[src]

impl<'a> ShlAssign<&'a i16> for H160[src]

impl<'a> ShlAssign<&'a i32> for H160[src]

impl<'a> ShlAssign<&'a i64> for H160[src]

impl<'a> ShlAssign<&'a i8> for H160[src]

impl<'a> ShlAssign<&'a isize> for H160[src]

impl<'a> ShlAssign<&'a u128> for H160[src]

impl<'a> ShlAssign<&'a u16> for H160[src]

impl<'a> ShlAssign<&'a u32> for H160[src]

impl<'a> ShlAssign<&'a u64> for H160[src]

impl<'a> ShlAssign<&'a u8> for H160[src]

impl<'a> ShlAssign<&'a usize> for H160[src]

impl ShlAssign<i128> for H160[src]

impl ShlAssign<i16> for H160[src]

impl ShlAssign<i32> for H160[src]

impl ShlAssign<i64> for H160[src]

impl ShlAssign<i8> for H160[src]

impl ShlAssign<isize> for H160[src]

impl ShlAssign<u128> for H160[src]

impl ShlAssign<u16> for H160[src]

impl ShlAssign<u32> for H160[src]

impl ShlAssign<u64> for H160[src]

impl ShlAssign<u8> for H160[src]

impl ShlAssign<usize> for H160[src]

impl<'a, 'b> Shr<&'a i128> for &'b H160[src]

type Output = H160

The resulting type after applying the >> operator.

impl<'a> Shr<&'a i128> for H160[src]

type Output = H160

The resulting type after applying the >> operator.

impl<'a, 'b> Shr<&'a i16> for &'b H160[src]

type Output = H160

The resulting type after applying the >> operator.

impl<'a> Shr<&'a i16> for H160[src]

type Output = H160

The resulting type after applying the >> operator.

impl<'a, 'b> Shr<&'a i32> for &'b H160[src]

type Output = H160

The resulting type after applying the >> operator.

impl<'a> Shr<&'a i32> for H160[src]

type Output = H160

The resulting type after applying the >> operator.

impl<'a, 'b> Shr<&'a i64> for &'b H160[src]

type Output = H160

The resulting type after applying the >> operator.

impl<'a> Shr<&'a i64> for H160[src]

type Output = H160

The resulting type after applying the >> operator.

impl<'a, 'b> Shr<&'a i8> for &'b H160[src]

type Output = H160

The resulting type after applying the >> operator.

impl<'a> Shr<&'a i8> for H160[src]

type Output = H160

The resulting type after applying the >> operator.

impl<'a, 'b> Shr<&'a isize> for &'b H160[src]

type Output = H160

The resulting type after applying the >> operator.

impl<'a> Shr<&'a isize> for H160[src]

type Output = H160

The resulting type after applying the >> operator.

impl<'a, 'b> Shr<&'a u128> for &'b H160[src]

type Output = H160

The resulting type after applying the >> operator.

impl<'a> Shr<&'a u128> for H160[src]

type Output = H160

The resulting type after applying the >> operator.

impl<'a, 'b> Shr<&'a u16> for &'b H160[src]

type Output = H160

The resulting type after applying the >> operator.

impl<'a> Shr<&'a u16> for H160[src]

type Output = H160

The resulting type after applying the >> operator.

impl<'a, 'b> Shr<&'a u32> for &'b H160[src]

type Output = H160

The resulting type after applying the >> operator.

impl<'a> Shr<&'a u32> for H160[src]

type Output = H160

The resulting type after applying the >> operator.

impl<'a, 'b> Shr<&'a u64> for &'b H160[src]

type Output = H160

The resulting type after applying the >> operator.

impl<'a> Shr<&'a u64> for H160[src]

type Output = H160

The resulting type after applying the >> operator.

impl<'a, 'b> Shr<&'a u8> for &'b H160[src]

type Output = H160

The resulting type after applying the >> operator.

impl<'a> Shr<&'a u8> for H160[src]

type Output = H160

The resulting type after applying the >> operator.

impl<'a, 'b> Shr<&'a usize> for &'b H160[src]

type Output = H160

The resulting type after applying the >> operator.

impl<'a> Shr<&'a usize> for H160[src]

type Output = H160

The resulting type after applying the >> operator.

impl<'a> Shr<i128> for &'a H160[src]

type Output = H160

The resulting type after applying the >> operator.

impl Shr<i128> for H160[src]

type Output = H160

The resulting type after applying the >> operator.

impl<'a> Shr<i16> for &'a H160[src]

type Output = H160

The resulting type after applying the >> operator.

impl Shr<i16> for H160[src]

type Output = H160

The resulting type after applying the >> operator.

impl<'a> Shr<i32> for &'a H160[src]

type Output = H160

The resulting type after applying the >> operator.

impl Shr<i32> for H160[src]

type Output = H160

The resulting type after applying the >> operator.

impl<'a> Shr<i64> for &'a H160[src]

type Output = H160

The resulting type after applying the >> operator.

impl Shr<i64> for H160[src]

type Output = H160

The resulting type after applying the >> operator.

impl<'a> Shr<i8> for &'a H160[src]

type Output = H160

The resulting type after applying the >> operator.

impl Shr<i8> for H160[src]

type Output = H160

The resulting type after applying the >> operator.

impl<'a> Shr<isize> for &'a H160[src]

type Output = H160

The resulting type after applying the >> operator.

impl Shr<isize> for H160[src]

type Output = H160

The resulting type after applying the >> operator.

impl<'a> Shr<u128> for &'a H160[src]

type Output = H160

The resulting type after applying the >> operator.

impl Shr<u128> for H160[src]

type Output = H160

The resulting type after applying the >> operator.

impl<'a> Shr<u16> for &'a H160[src]

type Output = H160

The resulting type after applying the >> operator.

impl Shr<u16> for H160[src]

type Output = H160

The resulting type after applying the >> operator.

impl<'a> Shr<u32> for &'a H160[src]

type Output = H160

The resulting type after applying the >> operator.

impl Shr<u32> for H160[src]

type Output = H160

The resulting type after applying the >> operator.

impl<'a> Shr<u64> for &'a H160[src]

type Output = H160

The resulting type after applying the >> operator.

impl Shr<u64> for H160[src]

type Output = H160

The resulting type after applying the >> operator.

impl<'a> Shr<u8> for &'a H160[src]

type Output = H160

The resulting type after applying the >> operator.

impl Shr<u8> for H160[src]

type Output = H160

The resulting type after applying the >> operator.

impl<'a> Shr<usize> for &'a H160[src]

type Output = H160

The resulting type after applying the >> operator.

impl Shr<usize> for H160[src]

type Output = H160

The resulting type after applying the >> operator.

impl<'a> ShrAssign<&'a i128> for H160[src]

impl<'a> ShrAssign<&'a i16> for H160[src]

impl<'a> ShrAssign<&'a i32> for H160[src]

impl<'a> ShrAssign<&'a i64> for H160[src]

impl<'a> ShrAssign<&'a i8> for H160[src]

impl<'a> ShrAssign<&'a isize> for H160[src]

impl<'a> ShrAssign<&'a u128> for H160[src]

impl<'a> ShrAssign<&'a u16> for H160[src]

impl<'a> ShrAssign<&'a u32> for H160[src]

impl<'a> ShrAssign<&'a u64> for H160[src]

impl<'a> ShrAssign<&'a u8> for H160[src]

impl<'a> ShrAssign<&'a usize> for H160[src]

impl ShrAssign<i128> for H160[src]

impl ShrAssign<i16> for H160[src]

impl ShrAssign<i32> for H160[src]

impl ShrAssign<i64> for H160[src]

impl ShrAssign<i8> for H160[src]

impl ShrAssign<isize> for H160[src]

impl ShrAssign<u128> for H160[src]

impl ShrAssign<u16> for H160[src]

impl ShrAssign<u32> for H160[src]

impl ShrAssign<u64> for H160[src]

impl ShrAssign<u8> for H160[src]

impl ShrAssign<usize> for H160[src]

impl UpperHex for H160[src]

Auto Trait Implementations

impl RefUnwindSafe for H160

impl Send for H160

impl Sync for H160

impl Unpin for H160

impl UnwindSafe for H160

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> ToString for T where
    T: Display + ?Sized
[src]

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.