[][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.

Implementors

impl<Sv, T> Context<<T as ProcLoop>::Req, <T as ProcLoop>::ReqRes> for Yielder<Sv, T> where
    Sv: SvCall<SwitchBackService>,
    Sv: SvCall<SwitchContextService>,
    T: ProcLoop<Context = Self>,