[][src]Trait drone_core::proc_loop::Sess

pub trait Sess: Send {
    type ProcLoop: ProcLoop;
    type Fiber: Fiber<Input = In<<Self::ProcLoop as ProcLoop>::Cmd, <Self::ProcLoop as ProcLoop>::ReqRes>, Yield = Out<<Self::ProcLoop as ProcLoop>::Req, <Self::ProcLoop as ProcLoop>::CmdRes>, Return = !> + Send;
    type Error: Send;
    fn fib(&mut self) -> Pin<&mut Self::Fiber>;
fn run_req(
        &mut self,
        req: <Self::ProcLoop as ProcLoop>::Req
    ) -> Pin<Box<dyn Future<Output = Result<<Self::ProcLoop as ProcLoop>::ReqRes, Self::Error>> + Send + 'a>>; fn cmd(
        &mut self,
        cmd: <Self::ProcLoop as ProcLoop>::Cmd
    ) -> Pin<Box<dyn Future<Output = Result<<Self::ProcLoop as ProcLoop>::CmdRes, Self::Error>> + Send + 'a>> { ... } }

A session type for the synchronous command loop ProcLoop.

A type that implements this trait should wrap the fiber for the command loop.

Associated Types

type ProcLoop: ProcLoop

The command loop interface.

type Fiber: Fiber<Input = In<<Self::ProcLoop as ProcLoop>::Cmd, <Self::ProcLoop as ProcLoop>::ReqRes>, Yield = Out<<Self::ProcLoop as ProcLoop>::Req, <Self::ProcLoop as ProcLoop>::CmdRes>, Return = !> + Send

Fiber that runs the command loop.

type Error: Send

Request error type.

Loading content...

Required methods

fn fib(&mut self) -> Pin<&mut Self::Fiber>

Returns a pinned mutable reference to the fiber.

fn run_req(
    &mut self,
    req: <Self::ProcLoop as ProcLoop>::Req
) -> Pin<Box<dyn Future<Output = Result<<Self::ProcLoop as ProcLoop>::ReqRes, Self::Error>> + Send + 'a>>

Returns a future that will return a result for the request req.

Loading content...

Provided methods

fn cmd(
    &mut self,
    cmd: <Self::ProcLoop as ProcLoop>::Cmd
) -> Pin<Box<dyn Future<Output = Result<<Self::ProcLoop as ProcLoop>::CmdRes, Self::Error>> + Send + 'a>>

Returns a future that will return a result for the command cmd.

Loading content...

Implementors

Loading content...