Trait oasis_runtime_sdk::module::MethodHandler
source · pub trait MethodHandler {
// Provided methods
fn prefetch(
_prefixes: &mut BTreeSet<Prefix>,
_method: &str,
body: Value,
_auth_info: &AuthInfo,
) -> DispatchResult<Value, Result<(), RuntimeError>> { ... }
fn dispatch_call<C: Context>(
_ctx: &C,
_method: &str,
body: Value,
) -> DispatchResult<Value, CallResult> { ... }
fn dispatch_query<C: Context>(
_ctx: &C,
_method: &str,
args: Value,
) -> DispatchResult<Value, Result<Value, RuntimeError>> { ... }
fn dispatch_message_result<C: Context>(
_ctx: &C,
_handler_name: &str,
result: MessageResult,
) -> DispatchResult<MessageResult, ()> { ... }
fn supported_methods() -> Vec<MethodHandlerInfo> { ... }
fn is_expensive_query(_method: &str) -> bool { ... }
fn is_allowed_private_km_query(_method: &str) -> bool { ... }
fn is_allowed_interactive_call(_method: &str) -> bool { ... }
}
Expand description
Method handler.
Provided Methods§
sourcefn prefetch(
_prefixes: &mut BTreeSet<Prefix>,
_method: &str,
body: Value,
_auth_info: &AuthInfo,
) -> DispatchResult<Value, Result<(), RuntimeError>>
fn prefetch( _prefixes: &mut BTreeSet<Prefix>, _method: &str, body: Value, _auth_info: &AuthInfo, ) -> DispatchResult<Value, Result<(), RuntimeError>>
Add storage prefixes to prefetch.
sourcefn dispatch_call<C: Context>(
_ctx: &C,
_method: &str,
body: Value,
) -> DispatchResult<Value, CallResult>
fn dispatch_call<C: Context>( _ctx: &C, _method: &str, body: Value, ) -> DispatchResult<Value, CallResult>
Dispatch a call.
sourcefn dispatch_query<C: Context>(
_ctx: &C,
_method: &str,
args: Value,
) -> DispatchResult<Value, Result<Value, RuntimeError>>
fn dispatch_query<C: Context>( _ctx: &C, _method: &str, args: Value, ) -> DispatchResult<Value, Result<Value, RuntimeError>>
Dispatch a query.
sourcefn dispatch_message_result<C: Context>(
_ctx: &C,
_handler_name: &str,
result: MessageResult,
) -> DispatchResult<MessageResult, ()>
fn dispatch_message_result<C: Context>( _ctx: &C, _handler_name: &str, result: MessageResult, ) -> DispatchResult<MessageResult, ()>
Dispatch a message result.
sourcefn supported_methods() -> Vec<MethodHandlerInfo>
fn supported_methods() -> Vec<MethodHandlerInfo>
Lists the names of all RPC methods exposed by this module. The result is informational only. An empty return vector means that the implementor does not care to list the methods, or the implementor is a tuple of modules.
sourcefn is_expensive_query(_method: &str) -> bool
fn is_expensive_query(_method: &str) -> bool
Checks whether the given query method is tagged as expensive.
sourcefn is_allowed_private_km_query(_method: &str) -> bool
fn is_allowed_private_km_query(_method: &str) -> bool
Checks whether the given query is allowed to access private key manager state.
sourcefn is_allowed_interactive_call(_method: &str) -> bool
fn is_allowed_interactive_call(_method: &str) -> bool
Checks whether the given call is allowed to be called interactively via read-only transactions.
Object Safety§
This trait is not object safe.