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
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: u64The 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: u64The timestamp of the head block.
Implementations§
Source§impl Head
impl Head
Sourcepub 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§
Source§impl<'de> Deserialize<'de> for Head
impl<'de> Deserialize<'de> for Head
Source§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
Source§impl Ord for Head
impl Ord for Head
Source§impl PartialOrd for Head
impl PartialOrd for Head
Source§impl Serialize for Head
impl Serialize for Head
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 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,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<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.Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more