Trait linera_execution::UserApplication
source · pub trait UserApplication {
// Required methods
fn initialize<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
context: &'life1 OperationContext,
runtime: &'life2 dyn ContractRuntime,
argument: &'life3 [u8]
) -> Pin<Box<dyn Future<Output = Result<RawExecutionResult<Vec<u8>>, ExecutionError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait;
fn execute_operation<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
context: &'life1 OperationContext,
runtime: &'life2 dyn ContractRuntime,
operation: &'life3 [u8]
) -> Pin<Box<dyn Future<Output = Result<RawExecutionResult<Vec<u8>>, ExecutionError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait;
fn execute_message<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
context: &'life1 MessageContext,
runtime: &'life2 dyn ContractRuntime,
message: &'life3 [u8]
) -> Pin<Box<dyn Future<Output = Result<RawExecutionResult<Vec<u8>>, ExecutionError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait;
fn handle_application_call<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
context: &'life1 CalleeContext,
runtime: &'life2 dyn ContractRuntime,
argument: &'life3 [u8],
forwarded_sessions: Vec<SessionId>
) -> Pin<Box<dyn Future<Output = Result<ApplicationCallResult, ExecutionError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait;
fn handle_session_call<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>(
&'life0 self,
context: &'life1 CalleeContext,
runtime: &'life2 dyn ContractRuntime,
session_state: &'life3 mut Vec<u8>,
argument: &'life4 [u8],
forwarded_sessions: Vec<SessionId>
) -> Pin<Box<dyn Future<Output = Result<SessionCallResult, ExecutionError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait;
fn query_application<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
context: &'life1 QueryContext,
runtime: &'life2 dyn ServiceRuntime,
argument: &'life3 [u8]
) -> Pin<Box<dyn Future<Output = Result<Vec<u8>, ExecutionError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait;
}
Expand description
The public entry points provided by an application.
Required Methods§
sourcefn initialize<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
context: &'life1 OperationContext,
runtime: &'life2 dyn ContractRuntime,
argument: &'life3 [u8]
) -> Pin<Box<dyn Future<Output = Result<RawExecutionResult<Vec<u8>>, ExecutionError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn initialize<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, context: &'life1 OperationContext, runtime: &'life2 dyn ContractRuntime, argument: &'life3 [u8] ) -> Pin<Box<dyn Future<Output = Result<RawExecutionResult<Vec<u8>>, ExecutionError>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,
Initializes the application state on the chain that owns the application.
sourcefn execute_operation<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
context: &'life1 OperationContext,
runtime: &'life2 dyn ContractRuntime,
operation: &'life3 [u8]
) -> Pin<Box<dyn Future<Output = Result<RawExecutionResult<Vec<u8>>, ExecutionError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn execute_operation<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, context: &'life1 OperationContext, runtime: &'life2 dyn ContractRuntime, operation: &'life3 [u8] ) -> Pin<Box<dyn Future<Output = Result<RawExecutionResult<Vec<u8>>, ExecutionError>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,
Applies an operation from the current block.
sourcefn execute_message<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
context: &'life1 MessageContext,
runtime: &'life2 dyn ContractRuntime,
message: &'life3 [u8]
) -> Pin<Box<dyn Future<Output = Result<RawExecutionResult<Vec<u8>>, ExecutionError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn execute_message<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, context: &'life1 MessageContext, runtime: &'life2 dyn ContractRuntime, message: &'life3 [u8] ) -> Pin<Box<dyn Future<Output = Result<RawExecutionResult<Vec<u8>>, ExecutionError>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,
Applies a message originating from a cross-chain message.
sourcefn handle_application_call<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
context: &'life1 CalleeContext,
runtime: &'life2 dyn ContractRuntime,
argument: &'life3 [u8],
forwarded_sessions: Vec<SessionId>
) -> Pin<Box<dyn Future<Output = Result<ApplicationCallResult, ExecutionError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn handle_application_call<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, context: &'life1 CalleeContext, runtime: &'life2 dyn ContractRuntime, argument: &'life3 [u8], forwarded_sessions: Vec<SessionId> ) -> Pin<Box<dyn Future<Output = Result<ApplicationCallResult, ExecutionError>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,
Executes a call from another application.
When an application is executing an operation or a message it may call other applications, which can in turn call other applications.
sourcefn handle_session_call<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>(
&'life0 self,
context: &'life1 CalleeContext,
runtime: &'life2 dyn ContractRuntime,
session_state: &'life3 mut Vec<u8>,
argument: &'life4 [u8],
forwarded_sessions: Vec<SessionId>
) -> Pin<Box<dyn Future<Output = Result<SessionCallResult, ExecutionError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
fn handle_session_call<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>( &'life0 self, context: &'life1 CalleeContext, runtime: &'life2 dyn ContractRuntime, session_state: &'life3 mut Vec<u8>, argument: &'life4 [u8], forwarded_sessions: Vec<SessionId> ) -> Pin<Box<dyn Future<Output = Result<SessionCallResult, ExecutionError>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait, 'life4: 'async_trait,
Executes a call from another application into a session created by this application.
sourcefn query_application<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
context: &'life1 QueryContext,
runtime: &'life2 dyn ServiceRuntime,
argument: &'life3 [u8]
) -> Pin<Box<dyn Future<Output = Result<Vec<u8>, ExecutionError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn query_application<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, context: &'life1 QueryContext, runtime: &'life2 dyn ServiceRuntime, argument: &'life3 [u8] ) -> Pin<Box<dyn Future<Output = Result<Vec<u8>, ExecutionError>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,
Executes unmetered read-only queries on the state of this application.
Note
This is not meant to be metered and may not be exposed by all validators.