Enum rotor_stream::Accept [] [src]

pub enum Accept<M: Machine, A: TryAccept + Sized> {
    Server(A),
    Connection(M),
}

Socket acceptor State Machine

TODO(tailhook) Currently this panics when there is no slab space when accepting a connection. This may be fixed by sleeping and retrying

Variants

Server(A)Connection(M)

Methods

impl<M, A> Accept<M, A> where A: TryAccept + Evented + Any, M: Machine
[src]

fn new<S: GenericScope>(sock: A, scope: &mut S) -> Result<Self, Box<Error>>

Trait Implementations

impl<M, A, S> Machine for Accept<M, A> where A: TryAccept<Output=S> + Evented + Any, S: StreamSocket, M: Machine + Accepted<S>
[src]

type Context = M::Context

Context type for the state machine Read more

type Seed = S

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

fn create(sock: S, scope: &mut Scope<Self::Context>) -> Result<Self, Box<Error>>

Create a machine from some data Read more

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

Socket readiness notification

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

Called after spawn event Read more

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

Timeout happened

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

Message received Read more

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

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