Struct pwasm_std::hash::H256 [−][src]
#[repr(C)]pub struct H256(pub [u8; 32]);
Unformatted binary data of fixed length.
Methods
impl H256
[src]
impl H256
pub fn new() -> H256
[src]
pub fn new() -> H256
Create a new, zero-initialised, instance.
pub fn zero() -> H256
[src]
pub fn zero() -> H256
Synonym for new()
. Prefer to new as it's more readable.
pub fn len() -> usize
[src]
pub fn len() -> usize
Get the size of this object in bytes.
pub fn as_ptr(&self) -> *const u8
[src]
pub fn as_ptr(&self) -> *const u8
Returns a constant raw pointer to the value
pub fn as_mut_ptr(&mut self) -> *mut u8
[src]
pub fn as_mut_ptr(&mut self) -> *mut u8
Returns a mutable raw pointer to the value
pub fn clone_from_slice(&mut self, src: &[u8]) -> usize
[src]
pub fn clone_from_slice(&mut self, src: &[u8]) -> usize
Assign self to be of the same value as a slice of bytes of length len()
.
pub fn from_slice(src: &[u8]) -> H256
[src]
pub fn from_slice(src: &[u8]) -> H256
Convert a slice of bytes of length len()
to an instance of this type.
pub fn copy_to(&self, dest: &mut [u8])
[src]
pub fn copy_to(&self, dest: &mut [u8])
Copy the data of this object into some mutable slice of length len()
.
pub fn contains(&'a self, b: &'a H256) -> bool
[src]
pub fn contains(&'a self, b: &'a H256) -> bool
Returns true
if all bits set in b
are also set in self
.
pub fn is_zero(&self) -> bool
[src]
pub fn is_zero(&self) -> bool
Returns true
if no bits are set.
pub fn low_u64(&self) -> u64
[src]
pub fn low_u64(&self) -> u64
Returns the lowest 8 bytes interpreted as a BigEndian integer.
Trait Implementations
impl Copy for H256
[src]
impl Copy for H256
impl Ord for H256
[src]
impl Ord for H256
fn cmp(&self, other: &H256) -> Ordering
[src]
fn cmp(&self, other: &H256) -> Ordering
This method returns an Ordering
between self
and other
. Read more
fn max(self, other: Self) -> Self
1.21.0[src]
fn max(self, other: Self) -> Self
Compares and returns the maximum of two values. Read more
fn min(self, other: Self) -> Self
1.21.0[src]
fn min(self, other: Self) -> Self
Compares and returns the minimum of two values. Read more
impl AsMut<[u8]> for H256
[src]
impl AsMut<[u8]> for H256
impl<'a> BitXor<&'a H256> for &'a H256
[src]
impl<'a> BitXor<&'a H256> for &'a H256
BitXor
on references
type Output = H256
The resulting type after applying the ^
operator.
fn bitxor(self, rhs: &'a H256) -> <&'a H256 as BitXor<&'a H256>>::Output
[src]
fn bitxor(self, rhs: &'a H256) -> <&'a H256 as BitXor<&'a H256>>::Output
Performs the ^
operation.
impl BitXor<H256> for H256
[src]
impl BitXor<H256> for H256
Moving BitXor
type Output = H256
The resulting type after applying the ^
operator.
fn bitxor(self, rhs: H256) -> <H256 as BitXor<H256>>::Output
[src]
fn bitxor(self, rhs: H256) -> <H256 as BitXor<H256>>::Output
Performs the ^
operation.
impl Deref for H256
[src]
impl Deref for H256
type Target = [u8]
The resulting type after dereferencing.
fn deref(&self) -> &[u8]
[src]
fn deref(&self) -> &[u8]
Dereferences the value.
impl Default for H256
[src]
impl Default for H256
impl DerefMut for H256
[src]
impl DerefMut for H256
impl Clone for H256
[src]
impl Clone for H256
fn clone(&self) -> H256
[src]
fn clone(&self) -> H256
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl<'a> BitOr<&'a H256> for &'a H256
[src]
impl<'a> BitOr<&'a H256> for &'a H256
BitOr
on references
type Output = H256
The resulting type after applying the |
operator.
fn bitor(self, rhs: &'a H256) -> <&'a H256 as BitOr<&'a H256>>::Output
[src]
fn bitor(self, rhs: &'a H256) -> <&'a H256 as BitOr<&'a H256>>::Output
Performs the |
operation.
impl BitOr<H256> for H256
[src]
impl BitOr<H256> for H256
Moving BitOr
type Output = H256
The resulting type after applying the |
operator.
fn bitor(self, rhs: H256) -> <H256 as BitOr<H256>>::Output
[src]
fn bitor(self, rhs: H256) -> <H256 as BitOr<H256>>::Output
Performs the |
operation.
impl Hash for H256
[src]
impl Hash for H256
fn hash<H>(&self, state: &mut H) where
H: Hasher,
[src]
fn hash<H>(&self, state: &mut H) where
H: Hasher,
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]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
Feeds a slice of this type into the given [Hasher
]. Read more
impl PartialOrd<H256> for H256
[src]
impl PartialOrd<H256> for H256
fn partial_cmp(&self, other: &H256) -> Option<Ordering>
[src]
fn partial_cmp(&self, other: &H256) -> Option<Ordering>
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]
fn lt(&self, other: &Rhs) -> bool
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]
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 more
fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
fn gt(&self, other: &Rhs) -> bool
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]
fn ge(&self, other: &Rhs) -> bool
This method tests greater than or equal to (for self
and other
) and is used by the >=
operator. Read more
impl BitAnd<H256> for H256
[src]
impl BitAnd<H256> for H256
Moving BitAnd
type Output = H256
The resulting type after applying the &
operator.
fn bitand(self, rhs: H256) -> <H256 as BitAnd<H256>>::Output
[src]
fn bitand(self, rhs: H256) -> <H256 as BitAnd<H256>>::Output
Performs the &
operation.
impl<'a> BitAnd<&'a H256> for &'a H256
[src]
impl<'a> BitAnd<&'a H256> for &'a H256
BitAnd
on references
type Output = H256
The resulting type after applying the &
operator.
fn bitand(self, rhs: &'a H256) -> <&'a H256 as BitAnd<&'a H256>>::Output
[src]
fn bitand(self, rhs: &'a H256) -> <&'a H256 as BitAnd<&'a H256>>::Output
Performs the &
operation.
impl Index<usize> for H256
[src]
impl Index<usize> for H256
type Output = u8
The returned type after indexing.
fn index(&self, index: usize) -> &u8
[src]
fn index(&self, index: usize) -> &u8
Performs the indexing (container[index]
) operation.
impl Index<RangeFull> for H256
[src]
impl Index<RangeFull> for H256
type Output = [u8]
The returned type after indexing.
fn index(&self, _index: RangeFull) -> &[u8]
[src]
fn index(&self, _index: RangeFull) -> &[u8]
Performs the indexing (container[index]
) operation.
impl Index<Range<usize>> for H256
[src]
impl Index<Range<usize>> for H256
type Output = [u8]
The returned type after indexing.
fn index(&self, index: Range<usize>) -> &[u8]
[src]
fn index(&self, index: Range<usize>) -> &[u8]
Performs the indexing (container[index]
) operation.
impl IndexMut<Range<usize>> for H256
[src]
impl IndexMut<Range<usize>> for H256
fn index_mut(&mut self, index: Range<usize>) -> &mut [u8]
[src]
fn index_mut(&mut self, index: Range<usize>) -> &mut [u8]
Performs the mutable indexing (container[index]
) operation.
impl IndexMut<RangeFull> for H256
[src]
impl IndexMut<RangeFull> for H256
fn index_mut(&mut self, _index: RangeFull) -> &mut [u8]
[src]
fn index_mut(&mut self, _index: RangeFull) -> &mut [u8]
Performs the mutable indexing (container[index]
) operation.
impl IndexMut<usize> for H256
[src]
impl IndexMut<usize> for H256
fn index_mut(&mut self, index: usize) -> &mut u8
[src]
fn index_mut(&mut self, index: usize) -> &mut u8
Performs the mutable indexing (container[index]
) operation.
impl From<H160> for H256
[src]
impl From<H160> for H256
impl From<[u8; 32]> for H256
[src]
impl From<[u8; 32]> for H256
impl From<H256> for U256
[src]
impl From<H256> for U256
impl<'a> From<&'a H160> for H256
[src]
impl<'a> From<&'a H160> for H256
impl From<H256> for H64
[src]
impl From<H256> for H64
impl<'a> From<&'a U256> for H256
[src]
impl<'a> From<&'a U256> for H256
impl<'a> From<&'a [u8]> for H256
[src]
impl<'a> From<&'a [u8]> for H256
impl From<u64> for H256
[src]
impl From<u64> for H256
impl From<H256> for H160
[src]
impl From<H256> for H160
impl From<H256> for [u8; 32]
[src]
impl From<H256> for [u8; 32]
impl From<U256> for H256
[src]
impl From<U256> for H256
impl<'a> From<&'a H256> for U256
[src]
impl<'a> From<&'a H256> for U256
impl PartialEq<H256> for H256
[src]
impl PartialEq<H256> for H256
fn eq(&self, other: &H256) -> bool
[src]
fn eq(&self, other: &H256) -> bool
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]
fn ne(&self, other: &Rhs) -> bool
This method tests for !=
.
impl Eq for H256
[src]
impl Eq for H256
impl AsRef<[u8]> for H256
[src]
impl AsRef<[u8]> for H256