[−][src]Struct exonum::blockchain::BlockchainBuilder
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
Auto Trait Implementations
impl !RefUnwindSafe for BlockchainBuilder
impl Send for BlockchainBuilder
impl !Sync for BlockchainBuilder
impl Unpin for BlockchainBuilder
impl !UnwindSafe for BlockchainBuilder
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,
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, 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.
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.
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>,