Trait crux_core::capability::Operation

source ·
pub trait Operation: Serialize + PartialEq + Send + 'static {
    type Output: DeserializeOwned + Send + 'static;
Expand description

Operation trait links together input and output of a side-effect.

You implement Operation on the payload sent by the capability to the shell using CapabilityContext::request_from_shell.

For example (from crux_http):

impl Operation for HttpRequest {
    type Output = HttpResponse;

Required Associated Types§


type Output: DeserializeOwned + Send + 'static

Output assigns the type this request results in.

Object Safety§

This trait is not object safe.



impl Operation for Never

Implement Operation for Never to allow using it as a capability operation.


type Output = ()


impl Operation for RenderOperation


type Output = ()