pub struct ForkchoiceState {
pub head_block_hash: B256,
pub safe_block_hash: B256,
pub finalized_block_hash: B256,
}
Expand description
This structure encapsulates the fork choice state
Fields§
§head_block_hash: B256
Hash of the head block.
safe_block_hash: B256
Hash of the safe block.
finalized_block_hash: B256
Hash of finalized block.
Implementations§
source§impl ForkchoiceState
impl ForkchoiceState
sourcepub fn state_head_hash(&self) -> Option<B256>
pub fn state_head_hash(&self) -> Option<B256>
Returns the head_block_hash
, only if it is not B256::ZERO
, otherwise this returns
None
.
sourcepub fn state_safe_hash(&self) -> Option<B256>
pub fn state_safe_hash(&self) -> Option<B256>
Returns the safe_block_hash
, only if it is not B256::ZERO
, otherwise this returns
None
.
sourcepub fn state_finalized_hash(&self) -> Option<B256>
pub fn state_finalized_hash(&self) -> Option<B256>
Returns the finalized_block_hash
, only if it is not B256::ZERO
, otherwise this
returns None
.
Trait Implementations§
source§impl Clone for ForkchoiceState
impl Clone for ForkchoiceState
source§fn clone(&self) -> ForkchoiceState
fn clone(&self) -> ForkchoiceState
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for ForkchoiceState
impl Debug for ForkchoiceState
source§impl Default for ForkchoiceState
impl Default for ForkchoiceState
source§fn default() -> ForkchoiceState
fn default() -> ForkchoiceState
Returns the “default value” for a type. Read more
source§impl<'de> Deserialize<'de> for ForkchoiceState
impl<'de> Deserialize<'de> for ForkchoiceState
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl PartialEq for ForkchoiceState
impl PartialEq for ForkchoiceState
source§impl Serialize for ForkchoiceState
impl Serialize for ForkchoiceState
impl Copy for ForkchoiceState
impl Eq for ForkchoiceState
impl StructuralPartialEq for ForkchoiceState
Auto Trait Implementations§
impl Freeze for ForkchoiceState
impl RefUnwindSafe for ForkchoiceState
impl Send for ForkchoiceState
impl Sync for ForkchoiceState
impl Unpin for ForkchoiceState
impl UnwindSafe for ForkchoiceState
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§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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