Struct rotor_stream::Stream
[−]
[src]
pub struct Stream<P: Protocol> { // some 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: Protocol> Stream<P>
fn transport(&mut self) -> Transport<P::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 protocol(&mut self) -> &mut P
Get a Protocol
object for the stream
This method is only useful if you want to adjust protocol dysyr externally (like update some values after pushing data to buffer). Just be sure to wake up state machine if needed by the protocol.