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

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

Creates a new token.

Safety

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

fn req(self, req: Req) -> ReqRes

Makes a new request req.

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

Loading content...

Implementors

Loading content...