pub struct BlockInfo {
pub hash: B256,
pub number: u64,
pub parent_hash: B256,
pub timestamp: u64,
}Expand description
Block Header Info
Fields§
§hash: B256The block hash
number: u64The block number
parent_hash: B256The parent block hash
timestamp: u64The block timestamp
Implementations§
Source§impl BlockInfo
impl BlockInfo
Sourcepub const fn new(
hash: B256,
number: u64,
parent_hash: B256,
timestamp: u64,
) -> Self
pub const fn new( hash: B256, number: u64, parent_hash: B256, timestamp: u64, ) -> Self
Instantiates a new BlockInfo.
Sourcepub const fn id(&self) -> BlockNumHash
pub const fn id(&self) -> BlockNumHash
Returns the block ID.
Sourcepub fn is_parent_of(&self, block: &Self) -> bool
pub fn is_parent_of(&self, block: &Self) -> bool
Returns true if this BlockInfo is the direct parent of the given block.
Trait Implementations§
impl Copy for BlockInfo
impl Eq for BlockInfo
impl StructuralPartialEq for BlockInfo
Auto Trait Implementations§
impl Freeze for BlockInfo
impl RefUnwindSafe for BlockInfo
impl Send for BlockInfo
impl Sync for BlockInfo
impl Unpin for BlockInfo
impl UnwindSafe for BlockInfo
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> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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