Type Alias SealedHeaderFor

Source
pub type SealedHeaderFor<N> = SealedHeader<<N as NodePrimitives>::BlockHeader>;
Expand description

Type alias for SealedHeader generic over the BlockHeader type of NodePrimitives.

Aliased Type§

struct SealedHeaderFor<N> { /* private fields */ }

Layout§

Note: Encountered an error during type layout; the type failed to be normalized.

Implementations

Source§

impl<H: Sealable> SealedHeader<&H>

Source

pub fn cloned(self) -> SealedHeader<H>
where H: Clone,

Maps a SealedHeader<&H> to a SealedHeader<H> by cloning the header.

Source§

impl<H: BlockHeader + Sealable> SealedHeader<H>

Source

pub fn num_hash(&self) -> BlockNumHash

Return the number hash tuple.

Source

pub fn block_with_parent(&self) -> BlockWithParent

Return a [BlockWithParent] for this header.

Source§

impl<H: TestHeader> SealedHeader<H>

Source

pub fn set_header(&mut self, header: H)

Available on crate feature test-utils only.

Updates the block header.

Source

pub fn set_hash(&mut self, hash: BlockHash)

Available on crate feature test-utils only.

Updates the block hash.

Source

pub fn header_mut(&mut self) -> &mut H

Available on crate feature test-utils only.

Returns a mutable reference to the header.

Source

pub fn set_parent_hash(&mut self, hash: BlockHash)

Available on crate feature test-utils only.

Updates the parent block hash.

Source

pub fn set_block_number(&mut self, number: BlockNumber)

Available on crate feature test-utils only.

Updates the block number.

Source

pub fn set_state_root(&mut self, state_root: B256)

Available on crate feature test-utils only.

Updates the block state root.

Source

pub fn set_difficulty(&mut self, difficulty: U256)

Available on crate feature test-utils only.

Updates the block difficulty.

Source§

impl<H> SealedHeader<H>

Source

pub fn new_unhashed(header: H) -> Self

Creates the sealed header without hashing the header.

Source

pub fn new(header: H, hash: BlockHash) -> Self

Creates the sealed header with the corresponding block hash.

Source

pub const fn header(&self) -> &H

Returns the sealed Header fields.

Source

pub fn clone_header(&self) -> H
where H: Clone,

Clone the header.

Source

pub fn into_header(self) -> H

Consumes the type and returns the wrapped header.

Source

pub fn unseal(self) -> H

Consumes the type and returns the wrapped header.

Source

pub fn sealed_ref(&self) -> SealedHeader<&H>

Converts from &SealedHeader<H> to SealedHeader<&H>.

Source§

impl<H: Sealable> SealedHeader<H>

Source

pub fn seal_slow(header: H) -> Self

Hashes the header and creates a sealed header.

Source

pub fn hash_ref(&self) -> &BlockHash

Returns the block hash.

Note: if the hash has not been computed yet, this will compute the hash: [Sealable::hash_slow].

Source

pub fn hash(&self) -> BlockHash

Returns a copy of the block hash.

Source

pub fn split(self) -> (H, BlockHash)

This is the inverse of Header::seal_slow which returns the raw header and hash.

Trait Implementations

Source§

impl<'a, H> Arbitrary<'a> for SealedHeader<H>
where H: for<'b> Arbitrary<'b> + Sealable,

Available on crate feature arbitrary only.
Source§

fn arbitrary(u: &mut Unstructured<'a>) -> Result<Self>

Generate an arbitrary value of Self from the given unstructured data. Read more
§

fn arbitrary_take_rest(u: Unstructured<'a>) -> Result<Self, Error>

Generate an arbitrary value of Self from the entirety of the given unstructured data. Read more
§

fn size_hint(depth: usize) -> (usize, Option<usize>)

Get a size hint for how many bytes out of an Unstructured this type needs to construct itself. Read more
§

fn try_size_hint( depth: usize, ) -> Result<(usize, Option<usize>), MaxRecursionReached>

Get a size hint for how many bytes out of an Unstructured this type needs to construct itself. Read more
Source§

impl<H> AsRef<H> for SealedHeader<H>

Source§

fn as_ref(&self) -> &H

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl<H: Clone> Clone for SealedHeader<H>

Source§

fn clone(&self) -> SealedHeader<H>

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<H: Debug> Debug for SealedHeader<H>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Decodable for SealedHeader

Source§

fn decode(buf: &mut &[u8]) -> Result<Self>

Decodes the blob into the appropriate type. buf must be advanced past the decoded object.
Source§

impl<H: Sealable + Default> Default for SealedHeader<H>

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<H> Deref for SealedHeader<H>

Source§

type Target = H

The resulting type after dereferencing.
Source§

fn deref(&self) -> &Self::Target

Dereferences the value.
Source§

impl<'de, H> Deserialize<'de> for SealedHeader<H>
where H: Deserialize<'de>,

Source§

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 Encodable for SealedHeader

Source§

fn encode(&self, out: &mut dyn BufMut)

Encodes the type into the out buffer.
§

fn length(&self) -> usize

Returns the length of the encoding of this type in bytes. Read more
Source§

impl<'a, H: Sealable + SerdeBincodeCompat> From<SealedHeader<'a, H>> for SealedHeader<H>

Available on crate feature serde-bincode-compat only.
Source§

fn from(value: SealedHeader<'a, H>) -> Self

Converts to this type from the input type.
Source§

impl<H: Sealable> Hash for SealedHeader<H>

Source§

fn hash<Ha: Hasher>(&self, state: &mut Ha)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl<H: InMemorySize> InMemorySize for SealedHeader<H>

Source§

fn size(&self) -> usize

Calculates a heuristic for the in-memory size of the SealedHeader.

Source§

impl<H: Sealable> PartialEq for SealedHeader<H>

Source§

fn eq(&self, other: &Self) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<H: Sealable + SerdeBincodeCompat> SerdeBincodeCompat for SealedHeader<H>

Available on crate feature serde-bincode-compat only.
Source§

type BincodeRepr<'a> = SealedHeader<'a, H>

Serde representation of the type for bincode serialization. Read more
Source§

fn as_repr(&self) -> Self::BincodeRepr<'_>

Convert this type into its bincode representation
Source§

fn from_repr(repr: Self::BincodeRepr<'_>) -> Self

Convert from the bincode representation
Source§

impl<H> Serialize for SealedHeader<H>
where H: Serialize,

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl<H: Sealable> Eq for SealedHeader<H>