pub struct PayloadStatus {
pub status: PayloadStatusEnum,
pub latest_valid_hash: Option<B256>,
}
Expand description
This structure contains the result of processing a payload or fork choice update.
Fields§
§status: PayloadStatusEnum
The status of the payload.
latest_valid_hash: Option<B256>
Hash of the most recent valid block in the branch defined by payload and its ancestors
Implementations§
source§impl PayloadStatus
impl PayloadStatus
sourcepub const fn new(
status: PayloadStatusEnum,
latest_valid_hash: Option<B256>,
) -> Self
pub const fn new( status: PayloadStatusEnum, latest_valid_hash: Option<B256>, ) -> Self
Initializes a new payload status.
sourcepub const fn from_status(status: PayloadStatusEnum) -> Self
pub const fn from_status(status: PayloadStatusEnum) -> Self
Creates a new payload status from the given status.
sourcepub const fn with_latest_valid_hash(self, latest_valid_hash: B256) -> Self
pub const fn with_latest_valid_hash(self, latest_valid_hash: B256) -> Self
Sets the latest valid hash.
sourcepub const fn maybe_latest_valid_hash(
self,
latest_valid_hash: Option<B256>,
) -> Self
pub const fn maybe_latest_valid_hash( self, latest_valid_hash: Option<B256>, ) -> Self
Sets the latest valid hash if it’s not None.
sourcepub const fn is_syncing(&self) -> bool
pub const fn is_syncing(&self) -> bool
Returns true if the payload status is syncing.
sourcepub const fn is_invalid(&self) -> bool
pub const fn is_invalid(&self) -> bool
Returns true if the payload status is invalid.
Trait Implementations§
source§impl Clone for PayloadStatus
impl Clone for PayloadStatus
source§fn clone(&self) -> PayloadStatus
fn clone(&self) -> PayloadStatus
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 PayloadStatus
impl Debug for PayloadStatus
source§impl<'de> Deserialize<'de> for PayloadStatus
impl<'de> Deserialize<'de> for PayloadStatus
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 Display for PayloadStatus
impl Display for PayloadStatus
source§impl PartialEq for PayloadStatus
impl PartialEq for PayloadStatus
source§impl Serialize for PayloadStatus
Available on crate feature serde
only.
impl Serialize for PayloadStatus
Available on crate feature
serde
only.impl Eq for PayloadStatus
impl StructuralPartialEq for PayloadStatus
Auto Trait Implementations§
impl Freeze for PayloadStatus
impl RefUnwindSafe for PayloadStatus
impl Send for PayloadStatus
impl Sync for PayloadStatus
impl Unpin for PayloadStatus
impl UnwindSafe for PayloadStatus
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