Trait drone_core::proc_loop::Context[][src]

pub trait Context<Req, ReqRes>: Copy + 'static {
    unsafe fn new() -> Self;
fn req(self, req: Req) -> ReqRes; }

A token that allows suspending synchronous code.

Required methods

unsafe fn new() -> Self[src]

Creates a new token.

Safety

It is unsafe to create a token inside an inappropriate context.

fn req(self, req: Req) -> ReqRes[src]

Makes a new request req.

This method suspends execution of the current task allowing to escape from synchronous code.

Loading content...

Implementors

Loading content...