#[repr(C)]pub struct H256(pub [u8; 32]);
Expand description
A 256-bits (32 bytes) hash type.
Tuple Fields§
§0: [u8; 32]
Implementations§
Source§impl H256
impl H256
Sourcepub fn repeat_byte(byte: u8) -> H256
pub fn repeat_byte(byte: u8) -> H256
Returns a new fixed hash where all bits are set to the given byte.
Sourcepub fn as_bytes_mut(&mut self) -> &mut [u8] ⓘ
pub fn as_bytes_mut(&mut self) -> &mut [u8] ⓘ
Extracts a mutable byte slice containing the entire fixed hash.
Sourcepub fn as_fixed_bytes(&self) -> &[u8; 32]
pub fn as_fixed_bytes(&self) -> &[u8; 32]
Extracts a reference to the byte array containing the entire fixed hash.
Sourcepub fn as_fixed_bytes_mut(&mut self) -> &mut [u8; 32]
pub fn as_fixed_bytes_mut(&mut self) -> &mut [u8; 32]
Extracts a reference to the byte array containing the entire fixed hash.
Sourcepub fn to_fixed_bytes(self) -> [u8; 32]
pub fn to_fixed_bytes(self) -> [u8; 32]
Returns the inner bytes array.
Sourcepub fn as_mut_ptr(&mut self) -> *mut u8
pub fn as_mut_ptr(&mut self) -> *mut u8
Returns a mutable raw pointer to the value.
Sourcepub fn assign_from_slice(&mut self, src: &[u8])
pub fn assign_from_slice(&mut self, src: &[u8])
Sourcepub fn from_slice(src: &[u8]) -> Self
pub fn from_slice(src: &[u8]) -> Self
Trait Implementations§
Source§impl<'r> BitAndAssign<&'r H256> for H256
impl<'r> BitAndAssign<&'r H256> for H256
Source§fn bitand_assign(&mut self, rhs: &'r H256)
fn bitand_assign(&mut self, rhs: &'r H256)
Performs the
&=
operation. Read moreSource§impl BitAndAssign for H256
impl BitAndAssign for H256
Source§fn bitand_assign(&mut self, rhs: H256)
fn bitand_assign(&mut self, rhs: H256)
Performs the
&=
operation. Read moreSource§impl<'r> BitOrAssign<&'r H256> for H256
impl<'r> BitOrAssign<&'r H256> for H256
Source§fn bitor_assign(&mut self, rhs: &'r H256)
fn bitor_assign(&mut self, rhs: &'r H256)
Performs the
|=
operation. Read moreSource§impl BitOrAssign for H256
impl BitOrAssign for H256
Source§fn bitor_assign(&mut self, rhs: H256)
fn bitor_assign(&mut self, rhs: H256)
Performs the
|=
operation. Read moreSource§impl<'r> BitXorAssign<&'r H256> for H256
impl<'r> BitXorAssign<&'r H256> for H256
Source§fn bitxor_assign(&mut self, rhs: &'r H256)
fn bitxor_assign(&mut self, rhs: &'r H256)
Performs the
^=
operation. Read moreSource§impl BitXorAssign for H256
impl BitXorAssign for H256
Source§fn bitxor_assign(&mut self, rhs: H256)
fn bitxor_assign(&mut self, rhs: H256)
Performs the
^=
operation. Read moreSource§impl<'de> Deserialize<'de> for H256
impl<'de> Deserialize<'de> for H256
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Ord for H256
impl Ord for H256
Source§impl PartialOrd for H256
impl PartialOrd for H256
impl Copy for H256
impl Eq for H256
Auto Trait Implementations§
impl Freeze for H256
impl RefUnwindSafe for H256
impl Send for H256
impl Sync for H256
impl Unpin for H256
impl UnwindSafe for H256
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more