#[repr(transparent)]pub struct H160(pub [u8; 20]);Expand description
A SHA160 hash type.
Tuple Fields§
§0: [u8; 20]Implementations§
Source§impl H160
impl H160
pub fn from_digest(digest: impl AsRef<[u8]>) -> H160
pub fn random() -> H160
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 slice
Sourcepub fn copy_from_slice(&mut self, value: &[u8]) -> &mut H160
pub fn copy_from_slice(&mut self, value: &[u8]) -> &mut H160
copies the hash into the provided buffer
Sourcepub const fn get_mut(&mut self) -> &mut [u8; 20]
pub const fn get_mut(&mut self) -> &mut [u8; 20]
returns a mutable reference to the hash as a byte array
Trait Implementations§
Source§impl<'de> Deserialize<'de> for H160
impl<'de> Deserialize<'de> for H160
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<H160, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<H160, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl From<GenericArray<u8, UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>>> for H160
impl From<GenericArray<u8, UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>>> for H160
Source§impl FromIterator<u8> for H160
impl FromIterator<u8> for H160
Source§impl IntoIterator for H160
impl IntoIterator for H160
Source§impl Serialize for H160
impl Serialize for H160
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 H160
impl Eq for H160
impl RawHash for H160
impl StructuralPartialEq for H160
Auto Trait Implementations§
impl Freeze for H160
impl RefUnwindSafe for H160
impl Send for H160
impl Sync for H160
impl Unpin for H160
impl UnwindSafe for H160
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