pub trait DispatchViewFunction {
// Required method
fn dispatch_view_function<O: Output>(
id: &ViewFunctionId,
input: &mut &[u8],
output: &mut O,
) -> Result<(), ViewFunctionDispatchError>;
}Expand description
Implemented by both pallets and the runtime. The runtime is dispatching by prefix using the
pezpallet implementation of ViewFunctionIdPrefix then the pezpallet is dispatching by suffix
using the methods implementation of ViewFunctionIdSuffix.
In more details, ViewFunctionId = ViewFunctionIdPrefix ++ ViewFunctionIdSuffix, where
ViewFunctionIdPrefix=twox_128(pezpallet_name) and
ViewFunctionIdSuffix=twox_128("fn_name(fnarg_types) -> return_ty"). The prefix is the same as
the storage prefix for pallets. The suffix is generated from the view function method type
signature, so is guaranteed to be unique for that pezpallet implementation.
Required Methods§
fn dispatch_view_function<O: Output>( id: &ViewFunctionId, input: &mut &[u8], output: &mut O, ) -> Result<(), ViewFunctionDispatchError>
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.