#[repr(transparent)]pub struct InvokeFlag(pub i32);Expand description
Flags that modify the behavior of a contract invocation.
These flags are used with the Invoke syscall to control how a subinvocation executes. They are combined using bitwise OR.
Note: InvokeFlagSet is NOT part of the Invocation struct itself, but is instead a parameter to the Invoke syscall. The root transaction invocation always has no flags set (equivalent to None).
Tuple Fields§
§0: i32Implementations§
Source§impl InvokeFlag
impl InvokeFlag
Sourcepub const None: InvokeFlag
pub const None: InvokeFlag
No special behavior (default).
Sourcepub const TryInvoke: InvokeFlag
pub const TryInvoke: InvokeFlag
Enable early conflict detection for parallel execution.
Thruput executes transactions in parallel without observing other transactions’ writes. After execution, a two-phase commit process commits writes to the database. If there’s a conflict, the entire transaction aborts.
TryInvoke pulls this conflict detection earlier: when a try_invoke frame finishes, it performs two-phase commit lock acquisition immediately. If any lock fails, the subinvocation frame reverts (but the caller can handle this gracefully).
This is nondeterministic, so the two-phase commit result (a boolean) is appended to
the nondeterministic_bits in NondeterministicProposalData for deterministic
re-execution by validators.
Sourcepub const ReadOnly: InvokeFlag
pub const ReadOnly: InvokeFlag
Prevent all state modifications in the subinvocation.
The subinvocation can read storage but cannot write, deploy contracts, or perform any other state-modifying operations.
Sourcepub const DelegateCall: InvokeFlag
pub const DelegateCall: InvokeFlag
Execute the target contract’s code in the caller’s context.
Similar to Ethereum’s DELEGATECALL: the invoked code runs with the caller’s storage and address context, allowing library-like code reuse.
TODO: This flag is not yet implemented. When implementing, provide a comprehensive specification of what changes and what doesn’t change in a delegatecall frame. For example, GetMsgSender and GetCurrentAddress should NOT change (they return the original caller and current address), but storage operations should operate on the caller’s storage. Document the behavior of all syscalls in a delegatecall context.
Trait Implementations§
Source§impl Clone for InvokeFlag
impl Clone for InvokeFlag
Source§fn clone(&self) -> InvokeFlag
fn clone(&self) -> InvokeFlag
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl ConstMaxSize for InvokeFlag
impl ConstMaxSize for InvokeFlag
Source§impl ConstMaxSize for InvokeFlag
impl ConstMaxSize for InvokeFlag
impl Copy for InvokeFlag
Source§impl Debug for InvokeFlag
impl Debug for InvokeFlag
Source§impl Display for InvokeFlag
Available on crate feature std only.
impl Display for InvokeFlag
std only.impl EncodesAs<InvokeFlag> for InvokeFlag
impl Eq for InvokeFlag
Source§impl From<i32> for InvokeFlag
impl From<i32> for InvokeFlag
Source§fn from(v: i32) -> InvokeFlag
fn from(v: i32) -> InvokeFlag
Source§impl Hash for InvokeFlag
impl Hash for InvokeFlag
Source§impl JsonSchema for InvokeFlag
impl JsonSchema for InvokeFlag
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read moreSource§impl Ord for InvokeFlag
impl Ord for InvokeFlag
Source§fn cmp(&self, other: &InvokeFlag) -> Ordering
fn cmp(&self, other: &InvokeFlag) -> Ordering
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for InvokeFlag
impl PartialEq for InvokeFlag
Source§impl PartialOrd for InvokeFlag
impl PartialOrd for InvokeFlag
Source§impl<'_r> ReadXDR<'_r> for InvokeFlag
impl<'_r> ReadXDR<'_r> for InvokeFlag
Source§fn read_xdr<R>(r: &mut R) -> Result<InvokeFlag, ReadError>where
R: Reader<'_r>,
fn read_xdr<R>(r: &mut R) -> Result<InvokeFlag, ReadError>where
R: Reader<'_r>,
Source§fn read_xdr_in_place<R, '__xdrs_s>(
r: &mut R,
__xdrs_slot: Slot<'__xdrs_s, InvokeFlag>,
) -> Result<Init<'__xdrs_s, InvokeFlag>, ReadError>where
R: Reader<'_r>,
fn read_xdr_in_place<R, '__xdrs_s>(
r: &mut R,
__xdrs_slot: Slot<'__xdrs_s, InvokeFlag>,
) -> Result<Init<'__xdrs_s, InvokeFlag>, ReadError>where
R: Reader<'_r>,
slot, without first building it
on the stack. Read more