Struct common_types::header::Header [−][src]
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.
Implementations
impl Header
[src]
pub fn new() -> Self
[src]
Create a new, default-valued, header.
pub fn parent_hash(&self) -> &H256
[src]
Get the parent_hash field of the header.
pub fn timestamp(&self) -> u64
[src]
Get the timestamp field of the header.
pub fn number(&self) -> BlockNumber
[src]
Get the number field of the header.
pub fn author(&self) -> &Address
[src]
Get the author field of the header.
pub fn extra_data(&self) -> &Bytes
[src]
Get the extra data field of the header.
pub fn state_root(&self) -> &H256
[src]
Get the state root field of the header.
pub fn receipts_root(&self) -> &H256
[src]
Get the receipts root field of the header.
pub fn log_bloom(&self) -> &Bloom
[src]
Get the log bloom field of the header.
pub fn transactions_root(&self) -> &H256
[src]
Get the transactions root field of the header.
pub fn uncles_hash(&self) -> &H256
[src]
Get the uncles hash field of the header.
pub fn gas_used(&self) -> &U256
[src]
Get the gas used field of the header.
pub fn gas_limit(&self) -> &U256
[src]
Get the gas limit field of the header.
pub fn difficulty(&self) -> &U256
[src]
Get the difficulty field of the header.
pub fn seal(&self) -> &[Bytes]
[src]
Get the seal field of the header.
pub fn decode_seal<'a, T: FromIterator<&'a [u8]>>(
&'a self
) -> Result<T, DecoderError>
[src]
&'a self
) -> Result<T, DecoderError>
Get the seal field with RLP-decoded values as bytes.
pub fn set_parent_hash(&mut self, a: H256)
[src]
Set the number field of the header.
pub fn set_uncles_hash(&mut self, a: H256)
[src]
Set the uncles hash field of the header.
pub fn set_state_root(&mut self, a: H256)
[src]
Set the state root field of the header.
pub fn set_transactions_root(&mut self, a: H256)
[src]
Set the transactions root field of the header.
pub fn set_receipts_root(&mut self, a: H256)
[src]
Set the receipts root field of the header.
pub fn set_log_bloom(&mut self, a: Bloom)
[src]
Set the log bloom field of the header.
pub fn set_timestamp(&mut self, a: u64)
[src]
Set the timestamp field of the header.
pub fn set_number(&mut self, a: BlockNumber)
[src]
Set the number field of the header.
pub fn set_author(&mut self, a: Address)
[src]
Set the author field of the header.
pub fn set_extra_data(&mut self, a: Bytes)
[src]
Set the extra data field of the header.
pub fn set_gas_used(&mut self, a: U256)
[src]
Set the gas used field of the header.
pub fn set_gas_limit(&mut self, a: U256)
[src]
Set the gas limit field of the header.
pub fn set_difficulty(&mut self, a: U256)
[src]
Set the difficulty field of the header.
pub fn set_seal(&mut self, a: Vec<Bytes>)
[src]
Set the seal field of the header.
pub fn compute_hash(&mut self) -> H256
[src]
Get & memoize the hash of this header (keccak of the RLP with seal).
pub fn hash(&self) -> H256
[src]
Get the hash of this header (keccak of the RLP with seal).
pub fn bare_hash(&self) -> H256
[src]
Get the hash of the header excluding the seal
pub fn encoded(&self) -> Header
[src]
Encode the header, getting a type-safe wrapper around the RLP.
Trait Implementations
impl Clone for Header
[src]
impl Debug for Header
[src]
impl Decodable for Header
[src]
fn decode(r: &Rlp<'_>) -> Result<Self, DecoderError>
[src]
impl Default for Header
[src]
impl Encodable for Header
[src]
impl Eq for Header
[src]
impl MallocSizeOf for Header
[src]
fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize
[src]
impl PartialEq<Header> for Header
[src]
impl StructuralEq for Header
[src]
Auto Trait Implementations
impl RefUnwindSafe for Header
impl Send for Header
impl Sync for Header
impl Unpin for Header
impl UnwindSafe for Header
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> MallocSizeOfExt for T where
T: MallocSizeOf,
[src]
T: MallocSizeOf,
pub fn malloc_size_of(&self) -> usize
[src]
impl<T> MaybeDebug for T where
T: Debug,
T: Debug,
impl<T> MaybeDebug for T where
T: Debug,
T: Debug,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,