[][src]Struct exonum::blockchain::BlockchainMut

pub struct BlockchainMut { /* fields omitted */ }

Mutable blockchain capable of processing transactions.

BlockchainMut combines Blockchain resources with a service dispatcher. The resulting combination cannot be cloned (unlike Blockchain), but can be sent across threads. It is possible to extract a Blockchain reference from BlockchainMut via AsRef trait.

Methods

impl BlockchainMut[src]

pub fn immutable_view(&self) -> Blockchain[src]

Returns a copy of immutable blockchain view.

pub fn snapshot(&self) -> Box<dyn Snapshot>[src]

Creates a read-only snapshot of the current storage state.

pub fn fork(&self) -> Fork[src]

Creates a snapshot of the current storage state that can be later committed into the storage via the merge method.

pub fn merge(&mut self, patch: Patch) -> StorageResult<()>[src]

Commits changes from the patch to the blockchain storage.

pub fn create_patch<C: ?Sized>(
    &self,
    block_params: BlockParams,
    tx_cache: &C
) -> BlockPatch where
    C: TransactionCache
[src]

Executes the given transactions from the pool. Collects the resulting changes from the current storage state and returns them with the hash of the resulting block.

Arguments

  • tx_cache is an ephemeral transaction cache used to retrieve transactions by their hash. It isn't necessary to wrap this cache in PersistentPool; this will be done within the method.

pub fn commit<I>(&mut self, patch: BlockPatch, precommits: I) -> Result<()> where
    I: IntoIterator<Item = Verified<Precommit>>, 
[src]

Commits to the blockchain a new block with the indicated changes and Precommit messages that authenticate the block. The processing of the patch depends on the block contents provided to create_patch() call that has created it. See BlockContents for more details.

Trait Implementations

impl AsRef<Blockchain> for BlockchainMut[src]

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