pub trait Operation {
// Required methods
fn op_type(&self) -> OpType;
fn full_type(&self) -> OpFullType;
fn id(&self) -> OpId;
fn contract_id(&self) -> ContractId;
fn transition_type(&self) -> Option<u16>;
fn extension_type(&self) -> Option<u16>;
fn metadata(
&self,
) -> &Confined<Vec<u8>, amplify::::collection::confinement::SmallBlob::{constant#0}, amplify::::collection::confinement::SmallBlob::{constant#1}> ⓘ;
fn globals(&self) -> &GlobalState;
fn valencies(&self) -> &Valencies;
fn assignments(&self) -> AssignmentsRef<'_>;
fn assignments_by_type(
&self,
t: u16,
) -> Option<TypedAssigns<BlindSeal<TxPtr>>>;
fn inputs(&self) -> Inputs;
}
Expand description
Required Methods§
Sourcefn op_type(&self) -> OpType
fn op_type(&self) -> OpType
Returns type of the operation (see OpType
). Unfortunately, this
can’t be just a const, since it will break our ability to convert
concrete Node
types into &dyn Node
(entities implementing traits
with const definitions can’t be made into objects)
Sourcefn full_type(&self) -> OpFullType
fn full_type(&self) -> OpFullType
Returns full contract operation type information
Sourcefn contract_id(&self) -> ContractId
fn contract_id(&self) -> ContractId
Returns ContractId
this operation belongs to.
Sourcefn transition_type(&self) -> Option<u16>
fn transition_type(&self) -> Option<u16>
Returns Option::Some
(
TransitionType
)
for transitions or
Option::None
for genesis and extension operation types
Sourcefn extension_type(&self) -> Option<u16>
fn extension_type(&self) -> Option<u16>
Returns Option::Some
(
ExtensionType
)
for extension nodes or
Option::None
for genesis and state transitions
Sourcefn metadata(
&self,
) -> &Confined<Vec<u8>, amplify::::collection::confinement::SmallBlob::{constant#0}, amplify::::collection::confinement::SmallBlob::{constant#1}> ⓘ
fn metadata( &self, ) -> &Confined<Vec<u8>, amplify::::collection::confinement::SmallBlob::{constant#0}, amplify::::collection::confinement::SmallBlob::{constant#1}> ⓘ
Returns metadata associated with the operation, if any.
Sourcefn globals(&self) -> &GlobalState
fn globals(&self) -> &GlobalState
Returns reference to a full set of metadata (in form of GlobalState
wrapper structure) for the contract operation.