#[repr(transparent)]pub struct H256(pub [u8; 32]);Expand description
A SHA256 hash.
Tuple Fields§
§0: [u8; 32]Implementations§
Source§impl H256
impl H256
Sourcepub fn from_digest<D>(digest: D) -> H256
pub fn from_digest<D>(digest: D) -> H256
returns a new instance of the hash from a digest
Sourcepub fn get_mut(&mut self) -> &mut [u8; 32]
pub fn get_mut(&mut self) -> &mut [u8; 32]
returns a mutable reference to the hash as a byte array
Sourcepub fn replace(&mut self, value: &[u8; 32]) -> [u8; 32]
pub fn replace(&mut self, value: &[u8; 32]) -> [u8; 32]
replace and return the current value with another
Sourcepub fn as_slice_mut(&mut self) -> &mut [u8] ⓘ
pub fn as_slice_mut(&mut self) -> &mut [u8] ⓘ
returns a mutable reference to the hash as a byte array
Sourcepub fn copy_from_slice(&mut self, value: &[u8]) -> &mut H256
pub fn copy_from_slice(&mut self, value: &[u8]) -> &mut H256
copies the hash into the provided buffer
Trait Implementations§
Source§impl AddAssign<f64> for H256
impl AddAssign<f64> for H256
Source§fn add_assign(&mut self, rhs: f64)
fn add_assign(&mut self, rhs: f64)
Performs the
+= operation. Read moreSource§impl AddAssign for H256
impl AddAssign for H256
Source§fn add_assign(&mut self, rhs: H256)
fn add_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<H256, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<H256, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl DivAssign<f64> for H256
impl DivAssign<f64> for H256
Source§fn div_assign(&mut self, rhs: f64)
fn div_assign(&mut self, rhs: f64)
Performs the
/= operation. Read moreSource§impl From<GenericArray<u8, UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>>> for H256
impl From<GenericArray<u8, UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>>> for H256
Source§impl From<H256> for GenericArray<u8, UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>>
impl From<H256> for GenericArray<u8, UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>>
Source§impl FromIterator<u8> for H256
impl FromIterator<u8> for H256
Source§impl IntoIterator for H256
impl IntoIterator for H256
Source§impl MulAssign<f64> for H256
impl MulAssign<f64> for H256
Source§fn mul_assign(&mut self, rhs: f64)
fn mul_assign(&mut self, rhs: f64)
Performs the
*= operation. Read moreSource§impl Ord for H256
impl Ord for H256
Source§impl PartialOrd for H256
impl PartialOrd for H256
Source§impl Serialize for H256
impl Serialize for H256
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl Copy for H256
impl Eq for H256
impl RawHash for H256
impl StructuralPartialEq 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<S, T> AsSliceMut<T> for S
impl<S, T> AsSliceMut<T> for S
fn __private__(&self) -> Seal
Source§fn as_mut_slice(&mut self) -> &mut [T]
fn as_mut_slice(&mut self) -> &mut [T]
converts the type into a mutable slice of its elements.
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