Struct ethcore::header::Header
[−]
[src]
pub struct Header { /* fields omitted */ }
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.
Methods
impl Header
[src]
impl Header
pub fn new() -> Self
[src]
pub fn new() -> Self
Create a new, default-valued, header.
pub fn parent_hash(&self) -> &H256
[src]
pub fn parent_hash(&self) -> &H256
Get the parent_hash field of the header.
pub fn timestamp(&self) -> u64
[src]
pub fn timestamp(&self) -> u64
Get the timestamp field of the header.
pub fn number(&self) -> BlockNumber
[src]
pub fn number(&self) -> BlockNumber
Get the number field of the header.
Get the author field of the header.
pub fn extra_data(&self) -> &Bytes
[src]
pub fn extra_data(&self) -> &Bytes
Get the extra data field of the header.
pub fn state_root(&self) -> &H256
[src]
pub fn state_root(&self) -> &H256
Get the state root field of the header.
pub fn receipts_root(&self) -> &H256
[src]
pub fn receipts_root(&self) -> &H256
Get the receipts root field of the header.
pub fn log_bloom(&self) -> &Bloom
[src]
pub fn log_bloom(&self) -> &Bloom
Get the log bloom field of the header.
pub fn transactions_root(&self) -> &H256
[src]
pub fn transactions_root(&self) -> &H256
Get the transactions root field of the header.
pub fn uncles_hash(&self) -> &H256
[src]
pub fn uncles_hash(&self) -> &H256
Get the uncles hash field of the header.
pub fn gas_used(&self) -> &U256
[src]
pub fn gas_used(&self) -> &U256
Get the gas used field of the header.
pub fn gas_limit(&self) -> &U256
[src]
pub fn gas_limit(&self) -> &U256
Get the gas limit field of the header.
pub fn difficulty(&self) -> &U256
[src]
pub fn difficulty(&self) -> &U256
Get the difficulty field of the header.
pub fn seal(&self) -> &[Bytes]
[src]
pub fn seal(&self) -> &[Bytes]
Get the seal field of the header.
pub fn decode_seal<'a, T: FromIterator<&'a [u8]>>(
&'a self
) -> Result<T, DecoderError>
[src]
pub fn decode_seal<'a, T: FromIterator<&'a [u8]>>(
&'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]
pub fn set_parent_hash(&mut self, a: H256)
Set the number field of the header.
pub fn set_uncles_hash(&mut self, a: H256)
[src]
pub fn set_uncles_hash(&mut self, a: H256)
Set the uncles hash field of the header.
pub fn set_state_root(&mut self, a: H256)
[src]
pub fn set_state_root(&mut self, a: H256)
Set the state root field of the header.
pub fn set_transactions_root(&mut self, a: H256)
[src]
pub fn set_transactions_root(&mut self, a: H256)
Set the transactions root field of the header.
pub fn set_receipts_root(&mut self, a: H256)
[src]
pub fn set_receipts_root(&mut self, a: H256)
Set the receipts root field of the header.
pub fn set_log_bloom(&mut self, a: Bloom)
[src]
pub fn set_log_bloom(&mut self, a: Bloom)
Set the log bloom field of the header.
pub fn set_timestamp(&mut self, a: u64)
[src]
pub fn set_timestamp(&mut self, a: u64)
Set the timestamp field of the header.
pub fn set_number(&mut self, a: BlockNumber)
[src]
pub fn set_number(&mut self, a: BlockNumber)
Set the number field of the header.
Set the author field of the header.
pub fn set_extra_data(&mut self, a: Bytes)
[src]
pub fn set_extra_data(&mut self, a: Bytes)
Set the extra data field of the header.
pub fn set_gas_used(&mut self, a: U256)
[src]
pub fn set_gas_used(&mut self, a: U256)
Set the gas used field of the header.
pub fn set_gas_limit(&mut self, a: U256)
[src]
pub fn set_gas_limit(&mut self, a: U256)
Set the gas limit field of the header.
pub fn set_difficulty(&mut self, a: U256)
[src]
pub fn set_difficulty(&mut self, a: U256)
Set the difficulty field of the header.
pub fn set_seal(&mut self, a: Vec<Bytes>)
[src]
pub fn set_seal(&mut self, a: Vec<Bytes>)
Set the seal field of the header.
pub fn compute_hash(&mut self) -> H256
[src]
pub fn compute_hash(&mut self) -> H256
Get & memoize the hash of this header (keccak of the RLP with seal).
pub fn hash(&self) -> H256
[src]
pub fn hash(&self) -> H256
Get the hash of this header (keccak of the RLP with seal).
pub fn bare_hash(&self) -> H256
[src]
pub fn bare_hash(&self) -> H256
Get the hash of the header excluding the seal
pub fn encoded(&self) -> Header
[src]
pub fn encoded(&self) -> Header
Encode the header, getting a type-safe wrapper around the RLP.
Trait Implementations
impl Debug for Header
[src]
impl Debug for Header
fn fmt(&self, __arg_0: &mut Formatter) -> Result
[src]
fn fmt(&self, __arg_0: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl Clone for Header
[src]
impl Clone for Header
fn clone(&self) -> Header
[src]
fn clone(&self) -> Header
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl Eq for Header
[src]
impl Eq for Header
impl PartialEq for Header
[src]
impl PartialEq for Header
fn eq(&self, c: &Header) -> bool
[src]
fn eq(&self, c: &Header) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
fn ne(&self, other: &Rhs) -> bool
This method tests for !=
.
impl Default for Header
[src]
impl Default for Header
impl Decodable for Header
[src]
impl Decodable for Header
impl Encodable for Header
[src]
impl Encodable for Header
fn rlp_append(&self, s: &mut RlpStream)
[src]
fn rlp_append(&self, s: &mut RlpStream)
Append a value to the stream
fn rlp_bytes(&self) -> ElasticArray1024<u8>
fn rlp_bytes(&self) -> ElasticArray1024<u8>
Get rlp-encoded bytes for this instance
impl HeapSizeOf for Header
[src]
impl HeapSizeOf for Header
fn heap_size_of_children(&self) -> usize
[src]
fn heap_size_of_children(&self) -> usize
Measure the size of any heap-allocated structures that hang off this value, but not the space taken up by the value itself (i.e. what size_of:: measures, more or less); that space is handled by the implementation of HeapSizeOf for Box below. Read more
impl Header for Header
[src]
impl Header for Header
fn bare_hash(&self) -> H256
[src]
fn bare_hash(&self) -> H256
Cryptographic hash of the header, excluding the seal.
fn hash(&self) -> H256
[src]
fn hash(&self) -> H256
Cryptographic hash of the header, including the seal.
fn seal(&self) -> &[Vec<u8>]
[src]
fn seal(&self) -> &[Vec<u8>]
Get a reference to the seal fields.
The author of the header.
fn number(&self) -> BlockNumber
[src]
fn number(&self) -> BlockNumber
The number of the header.
impl ScoredHeader for Header
[src]
impl ScoredHeader for Header
type Value = U256
fn score(&self) -> &U256
[src]
fn score(&self) -> &U256
Get the score of this header.
fn set_score(&mut self, score: U256)
[src]
fn set_score(&mut self, score: U256)
Set the score of this header.
impl BlockLike for Header
[src]
impl BlockLike for Header
fn hash(&self) -> H256
[src]
fn hash(&self) -> H256
Get the hash of this item.
fn parent_hash(&self) -> H256
[src]
fn parent_hash(&self) -> H256
Get the hash of this item's parent.
fn difficulty(&self) -> U256
[src]
fn difficulty(&self) -> U256
Get the difficulty of this item.