Struct keccak_hash::H256
source · [−]Expand description
Fixed-size uninterpreted hash type with 32 bytes (256 bits) size.
Tuple Fields
0: [u8; 32]
Implementations
sourceimpl H256
impl H256
sourcepub const fn repeat_byte(byte: u8) -> H256
pub const fn repeat_byte(byte: u8) -> H256
Returns a new fixed hash where all bits are set to the given byte.
sourcepub fn as_bytes(&self) -> &[u8]ⓘNotable traits for &[u8]impl Read for &[u8]impl Write for &mut [u8]
pub fn as_bytes(&self) -> &[u8]ⓘNotable traits for &[u8]impl Read for &[u8]impl Write for &mut [u8]
Extracts a byte slice containing the entire fixed hash.
sourcepub fn as_bytes_mut(&mut self) -> &mut [u8]ⓘNotable traits for &[u8]impl Read for &[u8]impl Write for &mut [u8]
pub fn as_bytes_mut(&mut self) -> &mut [u8]ⓘNotable traits for &[u8]impl Read for &[u8]impl Write for &mut [u8]
Extracts a mutable byte slice containing the entire fixed hash.
sourcepub const fn as_fixed_bytes(&self) -> &[u8; 32]
pub const 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 const fn to_fixed_bytes(self) -> [u8; 32]
pub const 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]) -> H256
pub fn from_slice(src: &[u8]) -> H256
Trait Implementations
sourceimpl<'r> BitAndAssign<&'r H256> for H256
impl<'r> BitAndAssign<&'r H256> for H256
sourcefn bitand_assign(&mut self, rhs: &'r H256)
fn bitand_assign(&mut self, rhs: &'r H256)
Performs the
&=
operation. Read moresourceimpl BitAndAssign<H256> for H256
impl BitAndAssign<H256> for H256
sourcefn bitand_assign(&mut self, rhs: H256)
fn bitand_assign(&mut self, rhs: H256)
Performs the
&=
operation. Read moresourceimpl<'r> BitOrAssign<&'r H256> for H256
impl<'r> BitOrAssign<&'r H256> for H256
sourcefn bitor_assign(&mut self, rhs: &'r H256)
fn bitor_assign(&mut self, rhs: &'r H256)
Performs the
|=
operation. Read moresourceimpl BitOrAssign<H256> for H256
impl BitOrAssign<H256> for H256
sourcefn bitor_assign(&mut self, rhs: H256)
fn bitor_assign(&mut self, rhs: H256)
Performs the
|=
operation. Read moresourceimpl<'r> BitXorAssign<&'r H256> for H256
impl<'r> BitXorAssign<&'r H256> for H256
sourcefn bitxor_assign(&mut self, rhs: &'r H256)
fn bitxor_assign(&mut self, rhs: &'r H256)
Performs the
^=
operation. Read moresourceimpl BitXorAssign<H256> for H256
impl BitXorAssign<H256> for H256
sourcefn bitxor_assign(&mut self, rhs: H256)
fn bitxor_assign(&mut self, rhs: H256)
Performs the
^=
operation. Read moresourceimpl<I> Index<I> for H256where
I: SliceIndex<[u8]>,
impl<I> Index<I> for H256where
I: SliceIndex<[u8]>,
type Output = <I as SliceIndex<[u8]>>::Output
type Output = <I as SliceIndex<[u8]>>::Output
The returned type after indexing.
sourceimpl Ord for H256
impl Ord for H256
1.21.0 · sourcefn max(self, other: Self) -> Self
fn max(self, other: Self) -> Self
Compares and returns the maximum of two values. Read more
1.21.0 · sourcefn min(self, other: Self) -> Self
fn min(self, other: Self) -> Self
Compares and returns the minimum of two values. Read more
1.50.0 · sourcefn clamp(self, min: Self, max: Self) -> Selfwhere
Self: PartialOrd<Self>,
fn clamp(self, min: Self, max: Self) -> Selfwhere
Self: PartialOrd<Self>,
Restrict a value to a certain interval. Read more
sourceimpl PartialOrd<H256> for H256
impl PartialOrd<H256> for H256
sourcefn partial_cmp(&self, other: &H256) -> Option<Ordering>
fn partial_cmp(&self, other: &H256) -> Option<Ordering>
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
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 moreimpl Copy for H256
impl Eq for H256
Auto Trait Implementations
impl RefUnwindSafe for H256
impl Send for H256
impl Sync for H256
impl Unpin for H256
impl UnwindSafe for H256
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToHex for Twhere
T: AsRef<[u8]>,
impl<T> ToHex for Twhere
T: AsRef<[u8]>,
sourcefn encode_hex<U>(&self) -> Uwhere
U: FromIterator<char>,
fn encode_hex<U>(&self) -> Uwhere
U: FromIterator<char>,
Encode the hex strict representing
self
into the result. Lower case
letters are used (e.g. f9b4ca
) Read moresourcefn encode_hex_upper<U>(&self) -> Uwhere
U: FromIterator<char>,
fn encode_hex_upper<U>(&self) -> Uwhere
U: FromIterator<char>,
Encode the hex strict representing
self
into the result. Upper case
letters are used (e.g. F9B4CA
) Read more