pub struct B256(pub [u8; 32]);Expand description
Thirty-two bytes: a transaction or block hash, a log topic, a storage slot.
Tuple Fields§
§0: [u8; 32]Implementations§
Source§impl B256
impl B256
pub const ZERO: B256
Sourcepub fn from_address(address: Address) -> B256
pub fn from_address(address: Address) -> B256
An address as a word: twelve zero bytes, then its twenty.
Sourcepub fn to_address(&self) -> Option<Address>
pub fn to_address(&self) -> Option<Address>
The address in the low twenty bytes, when the high twelve are zero:
how an indexed address sits in a log topic.
pub fn to_hex(&self) -> String
Trait Implementations§
impl Copy for B256
Source§impl<'de> Deserialize<'de> for B256
impl<'de> Deserialize<'de> for B256
Source§fn deserialize<D>(
deserializer: D,
) -> Result<B256, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
fn deserialize<D>(
deserializer: D,
) -> Result<B256, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for B256
Source§impl Ord for B256
impl Ord for B256
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
Source§impl PartialOrd for B256
impl PartialOrd for B256
Source§impl Serialize for B256
impl Serialize for B256
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 StructuralPartialEq for B256
Auto Trait Implementations§
impl Freeze for B256
impl RefUnwindSafe for B256
impl Send for B256
impl Sync for B256
impl Unpin for B256
impl UnsafeUnpin for B256
impl UnwindSafe for B256
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.