pub struct BlockHeaderFixedConsensusParameters {
pub solution_range: SolutionRange,
pub slot_iterations: NonZeroU32,
}
Expand description
Consensus parameters (on the beacon chain)
Fields§
§solution_range: SolutionRange
Solution range for this block/era
slot_iterations: NonZeroU32
The number of iterations for proof of time per slot.
Corresponds to the slot that is right after the parent block’s slot.
It can change before the slot of this block (see PotParametersChange
).
Implementations§
Source§impl BlockHeaderFixedConsensusParameters
impl BlockHeaderFixedConsensusParameters
Sourcepub fn try_from_bytes(bytes: &[u8]) -> Option<(Self, &[u8])>
pub fn try_from_bytes(bytes: &[u8]) -> Option<(Self, &[u8])>
Create an instance from provided bytes.
bytes
do not need to be aligned.
Returns an instance and remaining bytes on success.
Trait Implementations§
Source§impl Clone for BlockHeaderFixedConsensusParameters
impl Clone for BlockHeaderFixedConsensusParameters
Source§fn clone(&self) -> BlockHeaderFixedConsensusParameters
fn clone(&self) -> BlockHeaderFixedConsensusParameters
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 Decode for BlockHeaderFixedConsensusParameters
impl Decode for BlockHeaderFixedConsensusParameters
Source§fn decode<__CodecInputEdqy: Input>(
__codec_input_edqy: &mut __CodecInputEdqy,
) -> Result<Self, Error>
fn decode<__CodecInputEdqy: Input>( __codec_input_edqy: &mut __CodecInputEdqy, ) -> Result<Self, Error>
Attempt to deserialise the value from input.
§fn decode_into<I>(
input: &mut I,
dst: &mut MaybeUninit<Self>,
) -> Result<DecodeFinished, Error>where
I: Input,
fn decode_into<I>(
input: &mut I,
dst: &mut MaybeUninit<Self>,
) -> Result<DecodeFinished, Error>where
I: Input,
Attempt to deserialize the value from input into a pre-allocated piece of memory. Read more
§fn skip<I>(input: &mut I) -> Result<(), Error>where
I: Input,
fn skip<I>(input: &mut I) -> Result<(), Error>where
I: Input,
Attempt to skip the encoded value from input. Read more
§fn encoded_fixed_size() -> Option<usize>
fn encoded_fixed_size() -> Option<usize>
Returns the fixed encoded size of the type. Read more
Source§impl<'de> Deserialize<'de> for BlockHeaderFixedConsensusParameters
impl<'de> Deserialize<'de> for BlockHeaderFixedConsensusParameters
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 Encode for BlockHeaderFixedConsensusParameters
impl Encode for BlockHeaderFixedConsensusParameters
Source§fn size_hint(&self) -> usize
fn size_hint(&self) -> usize
If possible give a hint of expected size of the encoding. Read more
Source§fn encode_to<__CodecOutputEdqy: Output + ?Sized>(
&self,
__codec_dest_edqy: &mut __CodecOutputEdqy,
)
fn encode_to<__CodecOutputEdqy: Output + ?Sized>( &self, __codec_dest_edqy: &mut __CodecOutputEdqy, )
Convert self to a slice and append it to the destination.
§fn using_encoded<R, F>(&self, f: F) -> R
fn using_encoded<R, F>(&self, f: F) -> R
Convert self to a slice and then invoke the given closure with it.
§fn encoded_size(&self) -> usize
fn encoded_size(&self) -> usize
Calculates the encoded size. Read more
Source§impl MaxEncodedLen for BlockHeaderFixedConsensusParameters
impl MaxEncodedLen for BlockHeaderFixedConsensusParameters
Source§fn max_encoded_len() -> usize
fn max_encoded_len() -> usize
Upper bound, in bytes, of the maximum encoded size of this item.
Source§impl TypeInfo for BlockHeaderFixedConsensusParameters
impl TypeInfo for BlockHeaderFixedConsensusParameters
impl Copy for BlockHeaderFixedConsensusParameters
impl EncodeLike for BlockHeaderFixedConsensusParameters
Auto Trait Implementations§
impl Freeze for BlockHeaderFixedConsensusParameters
impl RefUnwindSafe for BlockHeaderFixedConsensusParameters
impl Send for BlockHeaderFixedConsensusParameters
impl Sync for BlockHeaderFixedConsensusParameters
impl Unpin for BlockHeaderFixedConsensusParameters
impl UnwindSafe for BlockHeaderFixedConsensusParameters
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<T> DecodeAll for Twhere
T: Decode,
impl<T> DecodeAll for Twhere
T: Decode,
§fn decode_all(input: &mut &[u8]) -> Result<T, Error>
fn decode_all(input: &mut &[u8]) -> Result<T, Error>
Decode
Self
and consume all of the given input data. Read more§impl<T> DecodeLimit for Twhere
T: Decode,
impl<T> DecodeLimit for Twhere
T: Decode,
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