[−][src]Enum exonum::blockchain::CallInBlock
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)
Call of before_transactions
hook in a service.
Fields of BeforeTransactions
id: InstanceId
Numerical service identifier.
Call of a transaction within the block.
Fields of Transaction
index: u32
Zero-based transaction index.
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]
fn size(&self) -> usize
[src]
fn write(&self, buffer: &mut [u8]) -> usize
[src]
fn read(buffer: &[u8]) -> Self::Owned
[src]
impl BinaryValue for CallInBlock
[src]
fn to_bytes(&self) -> Vec<u8>
[src]
fn from_bytes(value: Cow<[u8]>) -> Result<Self, Error>
[src]
fn into_bytes(self) -> Vec<u8>
[src]
impl Clone for CallInBlock
[src]
fn clone(&self) -> CallInBlock
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Copy for CallInBlock
[src]
impl Debug for CallInBlock
[src]
impl<'de> Deserialize<'de> for CallInBlock
[src]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
impl Display for CallInBlock
[src]
impl Eq for CallInBlock
[src]
impl Hash for CallInBlock
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl ObjectHash for CallInBlock
[src]
fn object_hash(&self) -> Hash
[src]
impl Ord for CallInBlock
[src]
fn cmp(&self, other: &CallInBlock) -> Ordering
[src]
#[must_use]fn max(self, other: Self) -> Self
1.21.0[src]
#[must_use]fn min(self, other: Self) -> Self
1.21.0[src]
#[must_use]fn clamp(self, min: Self, max: Self) -> Self
[src]
impl PartialEq<CallInBlock> for CallInBlock
[src]
fn eq(&self, other: &CallInBlock) -> bool
[src]
fn ne(&self, other: &CallInBlock) -> bool
[src]
impl PartialOrd<CallInBlock> for CallInBlock
[src]
fn partial_cmp(&self, other: &CallInBlock) -> Option<Ordering>
[src]
fn lt(&self, other: &CallInBlock) -> bool
[src]
fn le(&self, other: &CallInBlock) -> bool
[src]
fn gt(&self, other: &CallInBlock) -> bool
[src]
fn ge(&self, other: &CallInBlock) -> bool
[src]
impl ProtobufConvert for CallInBlock
[src]
type ProtoStruct = CallInBlock
Type generated from the Protobuf definition.
fn to_pb(&self) -> Self::ProtoStruct
[src]
fn from_pb(pb: Self::ProtoStruct) -> Result<Self>
[src]
impl Serialize for CallInBlock
[src]
fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
__S: Serializer,
[src]
__S: Serializer,
impl StructuralEq for CallInBlock
[src]
impl StructuralPartialEq for CallInBlock
[src]
Auto Trait Implementations
impl RefUnwindSafe for CallInBlock
impl Send for CallInBlock
impl Sync for CallInBlock
impl Unpin for CallInBlock
impl UnwindSafe for CallInBlock
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> DeserializeOwned for T where
T: Deserialize<'de>,
[src]
T: Deserialize<'de>,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
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>,