pub struct Header { /* private fields */ }
Expand description

A block header.

Reflects the specific RLP fields of a block in the chain with additional room for the seal which is non-specific.

Doesn’t do all that much on its own.

Two versions of header exist. First one is before EIP1559. Second version is after EIP1559. EIP1559 version added field base_fee_per_gas.

Implementations

Create a new, default-valued, header.

Get the parent_hash field of the header.

Get the timestamp field of the header.

Get the number field of the header.

Get the author field of the header.

Get the extra data field of the header.

Get the state root field of the header.

Get the receipts root field of the header.

Get the log bloom field of the header.

Get the transactions root field of the header.

Get the uncles hash field of the header.

Get the gas used field of the header.

Get the gas limit field of the header.

Get the difficulty field of the header.

Get the seal field of the header.

Get the base fee field of the header.

Get the seal field with RLP-decoded values as bytes.

Set the number field of the header.

Set the uncles hash field of the header.

Set the state root field of the header.

Set the transactions root field of the header.

Set the receipts root field of the header.

Set the log bloom field of the header.

Set the timestamp field of the header.

Set the number field of the header.

Set the author field of the header.

Set the extra data field of the header.

Set the gas used field of the header.

Set the gas limit field of the header.

Set the difficulty field of the header.

Set the seal field of the header.

Get & memoize the hash of this header (keccak of the RLP with seal).

Set the block base fee of the header.

Get the hash of this header (keccak of the RLP with seal).

Get the hash of the header excluding the seal

Encode the header, getting a type-safe wrapper around the RLP.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

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

Append a value to the stream

Get rlp-encoded bytes for this instance

Measure the heap usage of all descendant heap-allocated structures, but not the space taken up by the value itself. If T::size_of is a constant, consider implementing constant_size as well. Read more

Used to optimize MallocSizeOf implementation for collections like Vec and HashMap to avoid iterating over them unnecessarily. The Self: Sized bound is for object safety. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Method to launch a heapsize measurement with a fresh state. Read more

Should always be Self

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.