[][src]Enum exonum::blockchain::CallInBlock

#[non_exhaustive]pub enum CallInBlock {
    BeforeTransactions {
        id: InstanceId,
    },
    Transaction {
        index: u32,
    },
    AfterTransactions {
        id: InstanceId,
    },
}

Location of an isolated call within a block.

Exonum isolates execution of the transactions included into the the block, and before_transactions / after_transactions hooks that are executed for each active service. If an isolated call ends with an error, all changes to the blockchain state made within a call are rolled back.

CallInBlock objects are ordered in the same way the corresponding calls would be performed within a block:

assert!(CallInBlock::before_transactions(3) < CallInBlock::transaction(0));
assert!(CallInBlock::transaction(0) < CallInBlock::transaction(1));
assert!(CallInBlock::transaction(1) < CallInBlock::after_transactions(0));
assert!(CallInBlock::after_transactions(0) < CallInBlock::after_transactions(1));

See also

Not to be confused with CallSite, which provides information about a call in which an error may occur. Since Exonum services may call each other's methods, CallSite is richer than CallInBlock.

One example of difference between these types is CallType::Constructor: since services are constructed outside of the block processing routine, this kind of errors cannot be represented as CallInBlock.

Variants (Non-exhaustive)

Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
BeforeTransactions

Call of before_transactions hook in a service.

Fields of BeforeTransactions

id: InstanceId

Numerical service identifier.

Transaction

Call of a transaction within the block.

Fields of Transaction

index: u32

Zero-based transaction index.

AfterTransactions

Call of after_transactions hook in a service.

Fields of AfterTransactions

id: InstanceId

Numerical service identifier.

Methods

impl CallInBlock[src]

pub fn before_transactions(id: InstanceId) -> Self[src]

Creates a location corresponding to a before_transactions call.

pub fn transaction(index: u32) -> Self[src]

Creates a location corresponding to a transaction.

pub fn after_transactions(id: InstanceId) -> Self[src]

Creates a location corresponding to a after_transactions call.

Trait Implementations

impl BinaryKey for CallInBlock[src]

impl BinaryValue for CallInBlock[src]

impl Clone for CallInBlock[src]

impl Copy for CallInBlock[src]

impl Debug for CallInBlock[src]

impl<'de> Deserialize<'de> for CallInBlock[src]

impl Display for CallInBlock[src]

impl Eq for CallInBlock[src]

impl Hash for CallInBlock[src]

impl ObjectHash for CallInBlock[src]

impl Ord for CallInBlock[src]

impl PartialEq<CallInBlock> for CallInBlock[src]

impl PartialOrd<CallInBlock> for CallInBlock[src]

impl ProtobufConvert for CallInBlock[src]

type ProtoStruct = CallInBlock

Type generated from the Protobuf definition.

impl Serialize for CallInBlock[src]

impl StructuralEq for CallInBlock[src]

impl StructuralPartialEq for CallInBlock[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> DeserializeOwned for T where
    T: Deserialize<'de>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[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>,