Struct rotor_capnp::Stream
[−]
[src]
pub struct Stream<P> where
P: Protocol, { /* fields omitted */ }
A main stream state machine abstaction
You may use the Stream
directly. But it's recommented to either use
Persistent
for client connections or Accept
for server-side
connection processing.
Methods
impl<P> Stream<P> where
P: Protocol,
[src]
P: Protocol,
fn transport(&mut self) -> Transport<<P as Protocol>::Socket>
Get a Transport
object for the stream
This method is only useful if you want to manipulate buffers externally (like pushing to the buffer from another thread). Just be sure to wake up state machine after manipulating buffers.
fn new(
sock: <P as Protocol>::Socket,
seed: <P as Protocol>::Seed,
scope: &mut Scope<<P as Protocol>::Context>
) -> Response<Stream<P>, Void>
sock: <P as Protocol>::Socket,
seed: <P as Protocol>::Seed,
scope: &mut Scope<<P as Protocol>::Context>
) -> Response<Stream<P>, Void>
fn connected(
sock: <P as Protocol>::Socket,
seed: <P as Protocol>::Seed,
scope: &mut Scope<<P as Protocol>::Context>
) -> Response<Stream<P>, Void>
sock: <P as Protocol>::Socket,
seed: <P as Protocol>::Seed,
scope: &mut Scope<<P as Protocol>::Context>
) -> Response<Stream<P>, Void>
Trait Implementations
impl<P> Accepted<<P as Protocol>::Socket> for Stream<P> where
P: Protocol<Seed = ()> + Protocol,
[src]
P: Protocol<Seed = ()> + Protocol,
fn accepted(
sock: <P as Protocol>::Socket,
scope: &mut Scope<<Stream<P> as Machine>::Context>
) -> Response<Stream<P>, Void>
sock: <P as Protocol>::Socket,
scope: &mut Scope<<Stream<P> as Machine>::Context>
) -> Response<Stream<P>, Void>
impl<P> Machine for Stream<P> where
P: Protocol,
[src]
P: Protocol,
type Context = <P as Protocol>::Context
type Seed = Void
fn create(
void: Void,
_scope: &mut Scope<<Stream<P> as Machine>::Context>
) -> Response<Stream<P>, Void>
void: Void,
_scope: &mut Scope<<Stream<P> as Machine>::Context>
) -> Response<Stream<P>, Void>
fn ready(
self,
_events: EventSet,
scope: &mut Scope<<Stream<P> as Machine>::Context>
) -> Response<Stream<P>, <Stream<P> as Machine>::Seed>
self,
_events: EventSet,
scope: &mut Scope<<Stream<P> as Machine>::Context>
) -> Response<Stream<P>, <Stream<P> as Machine>::Seed>
fn spawned(
self,
_scope: &mut Scope<<Stream<P> as Machine>::Context>
) -> Response<Stream<P>, <Stream<P> as Machine>::Seed>
self,
_scope: &mut Scope<<Stream<P> as Machine>::Context>
) -> Response<Stream<P>, <Stream<P> as Machine>::Seed>
fn timeout(
self,
scope: &mut Scope<<Stream<P> as Machine>::Context>
) -> Response<Stream<P>, <Stream<P> as Machine>::Seed>
self,
scope: &mut Scope<<Stream<P> as Machine>::Context>
) -> Response<Stream<P>, <Stream<P> as Machine>::Seed>
fn wakeup(
self,
scope: &mut Scope<<Stream<P> as Machine>::Context>
) -> Response<Stream<P>, <Stream<P> as Machine>::Seed>
self,
scope: &mut Scope<<Stream<P> as Machine>::Context>
) -> Response<Stream<P>, <Stream<P> as Machine>::Seed>
impl<P> Debug for Stream<P> where
P: Protocol + Debug,
<P as Protocol>::Socket: Debug,
[src]
P: Protocol + Debug,
<P as Protocol>::Socket: Debug,