Function send

Source
pub fn send<'a, S: 'a + RpcSend + Copy, F: 'a + Fn(Deferred) -> S::Message>(
    sender: S,
    map: F,
) -> AsDeferred<S, F>
Expand description

An Inspect implementation that defers the inspection to another thread or context by sending the request on a [mesh] channel.

ยงUsage

enum MyRpc {
    Inspect(inspect::Deferred),
    SomeWork(mesh::rpc::Rpc<u32, u32>),
}

fn inspect_remote(sender: &mesh::Sender<MyRpc>, req: inspect::Request<'_>) {
    req.respond().merge(inspect::send(sender, MyRpc::Inspect));
}