[][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. See Fork for details.

pub fn create_patch(
    &self,
    proposer_id: ValidatorId,
    height: Height,
    tx_hashes: &[Hash],
    tx_cache: &mut BTreeMap<Hash, Verified<AnyTx>>
) -> (Hash, Patch)
[src]

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

pub fn commit<I>(
    &mut self,
    patch: Patch,
    block_hash: Hash,
    precommits: I,
    tx_cache: &mut BTreeMap<Hash, Verified<AnyTx>>
) -> Result<(), Error> where
    I: IntoIterator<Item = Verified<Precommit>>, 
[src]

Commits to the blockchain a new block with the indicated changes (patch), hash and Precommit messages. After that invokes after_commit for each service in the increasing order of their identifiers.

pub fn check_tx(&self, tx: &Verified<AnyTx>) -> Result<(), ExecutionError>[src]

Performs several shallow checks that transaction is correct.

Returned Ok(()) value doesn't necessarily mean that transaction is correct and will be executed successfully, but returned Err(..) value means that this transaction is obviously incorrect and should be declined as early as possible.

pub fn shutdown(&mut self)[src]

Shuts down the dispatcher. This should be the last operation performed on this instance.

pub fn remove_peer_with_pubkey(&mut self, key: &PublicKey)[src]

Removes from the cache the Connect message from a peer.

Trait Implementations

impl AsRef<Blockchain> for BlockchainMut[src]

impl Debug for BlockchainMut[src]

Auto Trait Implementations

Blanket Implementations

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 = !

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<T> Borrow<T> for T where
    T: ?Sized
[src]

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

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

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

impl<T> Erased for T