pub struct Request<Op>where
Op: Operation,{
pub operation: Op,
pub handle: RequestHandle<Op::Output>,
}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§handle: RequestHandle<Op::Output>Implementations§
Source§impl<Op> Request<Op>
impl<Op> Request<Op>
Sourcepub fn serialize<F, Eff, T>(self, effect: F) -> (Eff, ResolveSerialized<T>)
pub fn serialize<F, Eff, T>(self, effect: F) -> (Eff, ResolveSerialized<T>)
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.
Trait Implementations§
Source§impl<Op> Resolvable<<Op as Operation>::Output> for Request<Op>where
Op: Operation,
impl<Op> Resolvable<<Op as Operation>::Output> for Request<Op>where
Op: Operation,
Source§fn resolve(&mut self, output: Op::Output) -> Result<(), ResolveError>
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.
§Errors
Errors if the request cannot (or should not) be resolved.