[−][src]Struct exonum::blockchain::BlockchainMut
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]
&self,
block_params: BlockParams,
tx_cache: &C
) -> BlockPatch where
C: TransactionCache,
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 inPersistentPool
; 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]
I: IntoIterator<Item = Verified<Precommit>>,
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]
fn as_ref(&self) -> &Blockchain
[src]
impl Debug for BlockchainMut
[src]
Auto Trait Implementations
impl !RefUnwindSafe for BlockchainMut
impl Send for BlockchainMut
impl !Sync for BlockchainMut
impl Unpin for BlockchainMut
impl !UnwindSafe for BlockchainMut
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>,