#[repr(C)]pub struct H160(pub [u8; 20]);
Expand description
A 160 bits (20 bytes) hash type (aka Address
).
Tuple Fields§
§0: [u8; 20]
Implementations§
Source§impl H160
impl H160
Sourcepub fn repeat_byte(byte: u8) -> H160
pub fn repeat_byte(byte: u8) -> H160
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; 20]
pub fn as_fixed_bytes(&self) -> &[u8; 20]
Extracts a reference to the byte array containing the entire fixed hash.
Sourcepub fn as_fixed_bytes_mut(&mut self) -> &mut [u8; 20]
pub fn as_fixed_bytes_mut(&mut self) -> &mut [u8; 20]
Extracts a reference to the byte array containing the entire fixed hash.
Sourcepub fn to_fixed_bytes(self) -> [u8; 20]
pub fn to_fixed_bytes(self) -> [u8; 20]
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 H160> for H160
impl<'r> BitAndAssign<&'r H160> for H160
Source§fn bitand_assign(&mut self, rhs: &'r H160)
fn bitand_assign(&mut self, rhs: &'r H160)
Performs the
&=
operation. Read moreSource§impl BitAndAssign for H160
impl BitAndAssign for H160
Source§fn bitand_assign(&mut self, rhs: H160)
fn bitand_assign(&mut self, rhs: H160)
Performs the
&=
operation. Read moreSource§impl<'r> BitOrAssign<&'r H160> for H160
impl<'r> BitOrAssign<&'r H160> for H160
Source§fn bitor_assign(&mut self, rhs: &'r H160)
fn bitor_assign(&mut self, rhs: &'r H160)
Performs the
|=
operation. Read moreSource§impl BitOrAssign for H160
impl BitOrAssign for H160
Source§fn bitor_assign(&mut self, rhs: H160)
fn bitor_assign(&mut self, rhs: H160)
Performs the
|=
operation. Read moreSource§impl<'r> BitXorAssign<&'r H160> for H160
impl<'r> BitXorAssign<&'r H160> for H160
Source§fn bitxor_assign(&mut self, rhs: &'r H160)
fn bitxor_assign(&mut self, rhs: &'r H160)
Performs the
^=
operation. Read moreSource§impl BitXorAssign for H160
impl BitXorAssign for H160
Source§fn bitxor_assign(&mut self, rhs: H160)
fn bitxor_assign(&mut self, rhs: H160)
Performs the
^=
operation. Read moreSource§impl<'de> Deserialize<'de> for H160
impl<'de> Deserialize<'de> for H160
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 H160
impl Ord for H160
Source§impl PartialOrd for H160
impl PartialOrd for H160
impl Copy for H160
impl Eq 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<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