[][src]Struct exonum::blockchain::BlockchainBuilder

pub struct BlockchainBuilder { /* fields omitted */ }

The object responsible for the correct Exonum blockchain creation from the components.

During the Blockchain creation it creates and commits a genesis block if the database is empty. Otherwise, it restores the state from the database.

Methods

impl BlockchainBuilder[src]

pub fn new(blockchain: Blockchain) -> Self[src]

Creates a new builder instance based on the Blockchain.

pub fn with_genesis_config(self, genesis_config: GenesisConfig) -> Self[src]

Adds the genesis config to use if the blockchain is not yet initialized.

pub fn with_runtime(self, runtime: impl Into<RuntimeInstance>) -> Self[src]

Adds a runtime with the specified identifier and returns a modified Self object for further chaining.

pub fn build(self) -> BlockchainMut[src]

Returns blockchain instance, creates and commits the genesis block with the specified genesis configuration if the blockchain has not been initialized. Otherwise restores dispatcher state from database.

Panics

  • If the genesis config was not provided and the blockchain is not initialized.
  • If the genesis block cannot be created.
  • If storage version is not specified or not supported.

Trait Implementations

impl Debug for BlockchainBuilder[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, 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.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,