# 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]

#### `fn nonce(&self) -> H64`

Get the none field of the header.

#### `fn mix_hash(&self) -> H256`

Get the mix hash field of the header.

#### `fn set_nonce_and_mix_hash(&mut self, nonce: &H64, mix_hash: &H256)`

Set the nonce and mix hash fields of the header.

### `impl Header`
[src]

#### `fn new() -> Self`

Create a new, default-valued, header.

#### `fn parent_hash(&self) -> &H256`

Get the parent_hash field of the header.

#### `fn timestamp(&self) -> u64`

Get the timestamp field of the header.

#### `fn number(&self) -> BlockNumber`

Get the number field of the header.

#### `fn author(&self) -> &Address`

Get the author field of the header.

#### `fn extra_data(&self) -> &Bytes`

Get the extra data field of the header.

#### `fn extra_data_mut(&mut self) -> &mut Bytes`

Get a mutable reference to extra_data

#### `fn state_root(&self) -> &H256`

Get the state root field of the header.

#### `fn receipts_root(&self) -> &H256`

Get the receipts root field of the header.

#### `fn log_bloom(&self) -> &H2048`

Get the log bloom field of the header.

#### `fn transactions_root(&self) -> &H256`

Get the transactions root field of the header.

#### `fn uncles_hash(&self) -> &H256`

Get the uncles hash field of the header.

#### `fn gas_used(&self) -> &U256`

Get the gas used field of the header.

#### `fn gas_limit(&self) -> &U256`

Get the gas limit field of the header.

#### `fn difficulty(&self) -> &U256`

Get the difficulty field of the header.

#### `fn seal(&self) -> &[Bytes]`

Get the seal field of the header.

#### `fn set_parent_hash(&mut self, a: H256)`

Set the number field of the header.

#### `fn set_uncles_hash(&mut self, a: H256)`

Set the uncles hash field of the header.

#### `fn set_state_root(&mut self, a: H256)`

Set the state root field of the header.

#### `fn set_transactions_root(&mut self, a: H256)`

Set the transactions root field of the header.

#### `fn set_receipts_root(&mut self, a: H256)`

Set the receipts root field of the header.

#### `fn set_log_bloom(&mut self, a: H2048)`

Set the log bloom field of the header.

#### `fn set_timestamp(&mut self, a: u64)`

Set the timestamp field of the header.

#### `fn set_timestamp_now(&mut self, but_later_than: u64)`

Set the timestamp field of the header to the current time.

#### `fn set_number(&mut self, a: BlockNumber)`

Set the number field of the header.

#### `fn set_author(&mut self, a: Address)`

Set the author field of the header.

#### `fn set_extra_data(&mut self, a: Bytes)`

Set the extra data field of the header.

#### `fn set_gas_used(&mut self, a: U256)`

Set the gas used field of the header.

#### `fn set_gas_limit(&mut self, a: U256)`

Set the gas limit field of the header.

#### `fn set_difficulty(&mut self, a: U256)`

Set the difficulty field of the header.

#### `fn set_seal(&mut self, a: Vec<Bytes>)`

Set the seal field of the header.

#### `fn hash(&self) -> H256`

Get the hash of this header (sha3 of the RLP).

#### `fn bare_hash(&self) -> H256`

Get the hash of the header excluding the seal

#### `fn note_dirty(&self)`

Note that some fields have changed. Resets the memoised hash.

#### `fn stream_rlp(&self, s: &mut RlpStream, with_seal: Seal)`

Place this header into an RLP stream `s`, optionally `with_seal`.

#### `fn rlp(&self, with_seal: Seal) -> Bytes`

Get the RLP of this header, optionally `with_seal`.

#### `fn rlp_sha3(&self, with_seal: Seal) -> H256`

Get the SHA3 (Keccak) of this header, optionally `with_seal`.

## Trait Implementations

### `impl Debug for Header`
[src]

#### `fn fmt(&self, __arg_0: &mut Formatter) -> Result`

Formats the value using the given formatter.

### `impl Clone for Header`
[src]

#### `fn clone(&self) -> Header`

Returns a copy of the value. Read more

#### `fn clone_from(&mut self, source: &Self)`
1.0.0

Performs copy-assignment from `source`. Read more

### `impl Eq for Header`
[src]

### `impl PartialEq for Header`
[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

This method tests for `!=`.

### `impl Default for Header`
[src]

#### `fn default() -> Self`

Returns the "default value" for a type. Read more

### `impl Decodable for Header`
[src]

#### `fn decode<D>(decoder: &D) -> Result<Self, DecoderError> where D: Decoder`

Decode a value from RLP bytes

### `impl Encodable for Header`
[src]

#### `fn rlp_append(&self, s: &mut RlpStream)`

Append a value to the stream

#### `fn rlp_bytes(&self) -> ElasticArray1024<u8>`

Get rlp-encoded bytes for this instance

### `impl HeapSizeOf for Header`
[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::<T> measures, more or less); that space is handled by the implementation of HeapSizeOf for Box<T> below. Read more

### `impl BlockLike for Header`
[src]

#### `fn hash(&self) -> H256`

Get the hash of this item.

#### `fn parent_hash(&self) -> H256`

Get the hash of this item's parent.

#### `fn difficulty(&self) -> U256`

Get the difficulty of this item.

# Help

## Keyboard Shortcuts

?
  Show this help dialog
S
  Focus the search field
⇤
  Move up in search results
⇥
  Move down in search results
⏎
  Go to active search result
+
  Collapse/expand all sections

## Search Tricks

Prefix searches with a type followed by a colon (e.g. `fn:`) to restrict the search to a given type.

Accepted types are: `fn`, `mod`, `struct`, `enum`, `trait`, `type`, `macro`, and `const`.

Search functions by type signature (e.g. `vec -> usize` or `* -> vec`)