pub struct Request<Op>where
Op: Operation,{
pub operation: Op,
/* private fields */
}
Expand description
Request represents an effect request from the core to the shell.
The operation
is the input needed to process the effect, and will be one
of the capabilities’ Operation
types.
The request can be resolved by passing it to Core::resolve
along with the
corresponding result of type Operation::Output
.
Fields§
§operation: Op
Implementations§
Source§impl<Op> Request<Op>where
Op: Operation,
impl<Op> Request<Op>where
Op: Operation,
Sourcepub fn serialize<F, Eff>(self, effect: F) -> (Eff, ResolveSerialized)where
F: FnOnce(Op) -> Eff,
pub fn serialize<F, Eff>(self, effect: F) -> (Eff, ResolveSerialized)where
F: FnOnce(Op) -> Eff,
Serialize this effect request using effect
as a constructor
for a serializable Effect Eff
You should never need to call this method yourself, it will be called
by the generated implementation of Effect::serialize
,
which is used by the Bridge implementation.
Source§impl<Op> Request<Op>where
Op: Operation,
impl<Op> Request<Op>where
Op: Operation,
Sourcepub fn resolve(&mut self, output: Op::Output) -> Result<(), ResolveError>
pub fn resolve(&mut self, output: Op::Output) -> Result<(), ResolveError>
Resolve the request with the given output.
Note: This method should only be used in tests that work directly with
Command
.
If you are using AppTester
to test your app,
you should use AppTester::resolve
instead.