Struct rotor_stream::Persistent [] [src]

pub struct Persistent<P>(_, _, _) where P: Protocol, P::Socket: ActiveStream;

Persistent client connection

TODO(tailhook) this should include name resolution

Methods

impl<P> Persistent<P> where P: Protocol, P::Socket: ActiveStream, P::Socket::Address: Debug
[src]

fn new<S: GenericScope>(_scope: &mut S, address: P::Socket::Address, seed: P::Seed) -> Response<Persistent<P>, Void>

fn connect<S: GenericScope>(scope: &mut S, address: P::Socket::Address, seed: P::Seed) -> Response<Persistent<P>, Void>

impl<P> Persistent<P> where P: Protocol, P::Socket: ActiveStream
[src]

fn transport(&mut self) -> Option<Transport<P::Socket>>

Get a Transport object of the underlying 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.

Returns None if stream is not currently connected

Trait Implementations

impl<P: Protocol> Replaceable for Persistent<P> where P: Protocol, P::Seed: Clone, P::Socket::Address: Clone + Debug, P::Socket: ActiveStream
[src]

fn empty(&self) -> Self

Return the empty value that may be used as replacement Read more

fn restart(self, _scope: &mut Scope<Self::Context>) -> Response<Self, Self::Seed>

Restart a state machine from empty() state Read more

impl<P: Protocol> Machine for Persistent<P> where P: Protocol, P::Seed: Clone, P::Socket: ActiveStream, P::Socket::Address: Debug
[src]

type Context = P::Context

Context type for the state machine Read more

type Seed = Void

Seed is piece of data that is needed to initialize the machine Read more

fn create(seed: Self::Seed, _scope: &mut Scope<P::Context>) -> Response<Self, Void>

Create a machine from some data Read more

fn ready(self, events: EventSet, scope: &mut Scope<P::Context>) -> Response<Self, Self::Seed>

Socket readiness notification

fn spawned(self, _scope: &mut Scope<P::Context>) -> Response<Self, Self::Seed>

Called after spawn event Read more

fn timeout(self, scope: &mut Scope<P::Context>) -> Response<Self, Self::Seed>

Timeout happened

fn wakeup(self, scope: &mut Scope<P::Context>) -> Response<Self, Self::Seed>

Message received Read more

fn spawn_error(self, _scope: &mut Scope<Self::Context>, error: SpawnError<Self::Seed>) -> Response<Self, Self::Seed>

Called instead of spawned, if there is no slab space Read more