Struct oasis_runtime_sdk::dispatcher::Dispatcher
source · pub struct Dispatcher<R: Runtime> { /* private fields */ }
Expand description
The runtime dispatcher.
Implementations§
source§impl<R: Runtime> Dispatcher<R>
impl<R: Runtime> Dispatcher<R>
sourcepub fn decode_tx<C: Context>(ctx: &C, tx: &[u8]) -> Result<Transaction, Error>
pub fn decode_tx<C: Context>(ctx: &C, tx: &[u8]) -> Result<Transaction, Error>
Decode a runtime transaction.
sourcepub fn dispatch_tx_call<C: Context>(
ctx: &C,
call: Call,
opts: &DispatchOptions<'_>,
) -> (CallResult, Metadata)
pub fn dispatch_tx_call<C: Context>( ctx: &C, call: Call, opts: &DispatchOptions<'_>, ) -> (CallResult, Metadata)
Run the dispatch steps inside a transaction context. This includes the before call hooks, the call itself and after call hooks. The after call hooks are called regardless if the call succeeds or not.
sourcepub fn dispatch_tx_opts<C: Context>(
ctx: &C,
tx: Transaction,
opts: &DispatchOptions<'_>,
) -> Result<DispatchResult, Error>
pub fn dispatch_tx_opts<C: Context>( ctx: &C, tx: Transaction, opts: &DispatchOptions<'_>, ) -> Result<DispatchResult, Error>
Dispatch a runtime transaction in the given context with the provided options.
sourcepub fn dispatch_tx<C: Context>(
ctx: &C,
tx_size: u32,
tx: Transaction,
tx_index: usize,
) -> Result<DispatchResult, Error>
pub fn dispatch_tx<C: Context>( ctx: &C, tx_size: u32, tx: Transaction, tx_index: usize, ) -> Result<DispatchResult, Error>
Dispatch a runtime transaction in the given context.
sourcepub fn check_tx<C: Context>(
ctx: &C,
tx_size: u32,
tx: Transaction,
) -> Result<CheckTxResult, Error>
pub fn check_tx<C: Context>( ctx: &C, tx_size: u32, tx: Transaction, ) -> Result<CheckTxResult, Error>
Check whether the given transaction is valid.
sourcepub fn execute_tx_opts<C: Context>(
ctx: &C,
tx: Transaction,
opts: &DispatchOptions<'_>,
) -> Result<(CallResult, Tags), Error>
pub fn execute_tx_opts<C: Context>( ctx: &C, tx: Transaction, opts: &DispatchOptions<'_>, ) -> Result<(CallResult, Tags), Error>
Execute the given transaction, returning unserialized results.
sourcepub fn execute_tx<C: Context>(
ctx: &C,
tx_size: u32,
tx_hash: Hash,
tx: Transaction,
tx_index: usize,
) -> Result<ExecuteTxResult, Error>
pub fn execute_tx<C: Context>( ctx: &C, tx_size: u32, tx_hash: Hash, tx: Transaction, tx_index: usize, ) -> Result<ExecuteTxResult, Error>
Execute the given transaction.
sourcepub fn prefetch_tx(
prefixes: &mut BTreeSet<Prefix>,
tx: Transaction,
) -> Result<(), RuntimeError>
pub fn prefetch_tx( prefixes: &mut BTreeSet<Prefix>, tx: Transaction, ) -> Result<(), RuntimeError>
Prefetch prefixes for the given transaction.
sourcepub fn dispatch_query<C: Context>(
ctx: &C,
method: &str,
args: Vec<u8>,
) -> Result<Vec<u8>, RuntimeError>
pub fn dispatch_query<C: Context>( ctx: &C, method: &str, args: Vec<u8>, ) -> Result<Vec<u8>, RuntimeError>
Process the given runtime query.
sourcepub fn register_enclaverpc(&self, rpc: &mut RpcDispatcher)
pub fn register_enclaverpc(&self, rpc: &mut RpcDispatcher)
Register EnclaveRPC methods.
Trait Implementations§
source§impl<R: Runtime + Send + Sync> Dispatcher for Dispatcher<R>
impl<R: Runtime + Send + Sync> Dispatcher for Dispatcher<R>
source§fn execute_batch(
&self,
rt_ctx: Context<'_>,
batch: &TxnBatch,
_in_msgs: &[IncomingMessage],
) -> Result<ExecuteBatchResult, RuntimeError>
fn execute_batch( &self, rt_ctx: Context<'_>, batch: &TxnBatch, _in_msgs: &[IncomingMessage], ) -> Result<ExecuteBatchResult, RuntimeError>
Execute the transactions in the given batch. Read more
source§fn schedule_and_execute_batch(
&self,
rt_ctx: Context<'_>,
batch: &mut TxnBatch,
_in_msgs: &[IncomingMessage],
) -> Result<ExecuteBatchResult, RuntimeError>
fn schedule_and_execute_batch( &self, rt_ctx: Context<'_>, batch: &mut TxnBatch, _in_msgs: &[IncomingMessage], ) -> Result<ExecuteBatchResult, RuntimeError>
Schedule and execute transactions in the given batch. Read more
source§fn check_batch(
&self,
rt_ctx: Context<'_>,
batch: &TxnBatch,
) -> Result<Vec<CheckTxResult>, RuntimeError>
fn check_batch( &self, rt_ctx: Context<'_>, batch: &TxnBatch, ) -> Result<Vec<CheckTxResult>, RuntimeError>
Check the transactions in the given batch for validity. Read more
source§fn set_abort_batch_flag(&mut self, _abort_batch: Arc<AtomicBool>)
fn set_abort_batch_flag(&mut self, _abort_batch: Arc<AtomicBool>)
Configure abort batch flag.
source§fn query(
&self,
rt_ctx: Context<'_>,
method: &str,
args: Vec<u8>,
) -> Result<Vec<u8>, RuntimeError>
fn query( &self, rt_ctx: Context<'_>, method: &str, args: Vec<u8>, ) -> Result<Vec<u8>, RuntimeError>
Process a query. Read more
source§fn is_supported(&self) -> bool
fn is_supported(&self) -> bool
Whether dispatch is supported by this dispatcher.
Auto Trait Implementations§
impl<R> Freeze for Dispatcher<R>
impl<R> !RefUnwindSafe for Dispatcher<R>
impl<R> Send for Dispatcher<R>where
R: Send,
impl<R> Sync for Dispatcher<R>where
R: Sync,
impl<R> Unpin for Dispatcher<R>where
R: Unpin,
impl<R> !UnwindSafe for Dispatcher<R>
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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