pub struct InvokeHostFunctionOperation { /* private fields */ }Expand description
Represents an operation invoking a Soroban host function.
Soroban smart contracts are accessed through host functions that are executed atomically within the context of the transaction. This operation carries:
- The host function (one of:
- InvokeContract
- CreateContract
- UploadContractWasm
- CreateContractV2 )
- Authorization entries proving the required signatures / invocation authorizations
The XDR struct backing this is:
struct InvokeHostFunctionOp {
HostFunction hostFunction;
SorobanAuthorizationEntry auth<>;
};Implementations§
Source§impl InvokeHostFunctionOperation
impl InvokeHostFunctionOperation
Sourcepub fn source_account(&self) -> &Option<MuxedAccount>
pub fn source_account(&self) -> &Option<MuxedAccount>
Source account (if any) overriding the transaction source.
Sourcepub fn source_account_mut(&mut self) -> &mut Option<MuxedAccount>
pub fn source_account_mut(&mut self) -> &mut Option<MuxedAccount>
Mutable reference to the source account.
Sourcepub fn host_function(&self) -> &HostFunction
pub fn host_function(&self) -> &HostFunction
The host function to invoke.
Sourcepub fn host_function_mut(&mut self) -> &mut HostFunction
pub fn host_function_mut(&mut self) -> &mut HostFunction
Mutable reference to the host function.
Sourcepub fn auth(&self) -> &[SorobanAuthorizationEntry]
pub fn auth(&self) -> &[SorobanAuthorizationEntry]
Authorization entries.
Sourcepub fn auth_mut(&mut self) -> &mut Vec<SorobanAuthorizationEntry>
pub fn auth_mut(&mut self) -> &mut Vec<SorobanAuthorizationEntry>
Mutable authorization entries.
Sourcepub fn to_xdr_operation_body(&self) -> Result<OperationBody>
pub fn to_xdr_operation_body(&self) -> Result<OperationBody>
Returns the XDR operation body.
Sourcepub fn from_xdr_operation_body(
source_account: Option<MuxedAccount>,
x: &InvokeHostFunctionOp,
) -> Result<InvokeHostFunctionOperation>
pub fn from_xdr_operation_body( source_account: Option<MuxedAccount>, x: &InvokeHostFunctionOp, ) -> Result<InvokeHostFunctionOperation>
Creates from the XDR operation body.
Trait Implementations§
Source§impl Clone for InvokeHostFunctionOperation
impl Clone for InvokeHostFunctionOperation
Source§fn clone(&self) -> InvokeHostFunctionOperation
fn clone(&self) -> InvokeHostFunctionOperation
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for InvokeHostFunctionOperation
impl Debug for InvokeHostFunctionOperation
impl Eq for InvokeHostFunctionOperation
impl StructuralPartialEq for InvokeHostFunctionOperation
Auto Trait Implementations§
impl Freeze for InvokeHostFunctionOperation
impl RefUnwindSafe for InvokeHostFunctionOperation
impl Send for InvokeHostFunctionOperation
impl Sync for InvokeHostFunctionOperation
impl Unpin for InvokeHostFunctionOperation
impl UnwindSafe for InvokeHostFunctionOperation
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more