[][src]Struct ethereum_forkid::ForkFilter

pub struct ForkFilter { /* fields omitted */ }

Filter that describes the state of blockchain and can be used to check incoming ForkIds for compatibility.

Implementations

impl ForkFilter[src]

pub fn new<F>(head: BlockNumber, genesis: H256, forks: F) -> Self where
    F: IntoIterator<Item = BlockNumber>, 
[src]

Create the filter from provided head, genesis block hash, past forks and expected future forks.

pub fn set_head(&mut self, head: BlockNumber)[src]

Set the current head

#[must_use]pub const fn current(&self) -> ForkId[src]

Return current fork id

pub fn validate(&self, fork_id: ForkId) -> Result<(), ValidationError>[src]

Check whether the provided ForkId is compatible based on the validation rules in EIP-2124.

Errors

Returns a ValidationError if the ForkId is not compatible.

Trait Implementations

impl Clone for ForkFilter[src]

impl Debug for ForkFilter[src]

impl PartialEq<ForkFilter> for ForkFilter[src]

impl StructuralPartialEq for ForkFilter[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.