Struct Head
pub struct Head {
pub number: u64,
pub hash: FixedBytes<32>,
pub difficulty: Uint<256, 4>,
pub total_difficulty: Uint<256, 4>,
pub timestamp: u64,
}
Expand description
Re-exported EIP-2124 forkid types. Describes the current head block.
The head block is the highest fully synced block.
Note: This is a slimmed down version of Header, primarily for communicating the highest block with the P2P network and the RPC.
Fields§
§number: u64
The number of the head block.
hash: FixedBytes<32>
The hash of the head block.
difficulty: Uint<256, 4>
The difficulty of the head block.
total_difficulty: Uint<256, 4>
The total difficulty at the head block.
timestamp: u64
The timestamp of the head block.
Implementations§
§impl Head
impl Head
pub const fn new(
number: u64,
hash: FixedBytes<32>,
difficulty: Uint<256, 4>,
total_difficulty: Uint<256, 4>,
timestamp: u64,
) -> Head
pub const fn new( number: u64, hash: FixedBytes<32>, difficulty: Uint<256, 4>, total_difficulty: Uint<256, 4>, timestamp: u64, ) -> Head
Creates a new Head
instance.
Trait Implementations§
§impl<'de> Deserialize<'de> for Head
impl<'de> Deserialize<'de> for Head
§fn deserialize<__D>(
__deserializer: __D,
) -> Result<Head, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<Head, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
§impl Ord for Head
impl Ord for Head
§impl PartialOrd for Head
impl PartialOrd for Head
§impl Serialize for Head
impl Serialize for Head
§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 Head
impl Eq for Head
impl StructuralPartialEq for Head
Auto Trait Implementations§
impl Freeze for Head
impl RefUnwindSafe for Head
impl Send for Head
impl Sync for Head
impl Unpin for Head
impl UnwindSafe for Head
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...)
attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 112 bytes