Struct nemo::Session [] [src]

pub struct Session<P: Protocol, I>(_);

Sessions are containers of channels which store the current session type internally through a function pointer to a concrete handler.

Methods

impl<I, P: Handler<I, (), P::Initial>> Session<P, I>
[src]

fn new() -> Session<P, I>

Create a new session initialized to the Protocol.

impl<I, P: Handler<I, (), P::Initial::Dual>> Session<P, I>
[src]

fn new_dual() -> Session<P, I>

Create a new session initialized to the dual of the Protocol.

impl<'a, P: Protocol, I> Session<P, I>
[src]

fn with(&mut self, io: &'a mut I) -> bool

Operates the handler, returning false if the channel closed. This will panic if the channel was closed in a previous call.