Enum rotor_stream::Accept
[−]
[src]
pub enum Accept<M, A: TryAccept + Sized> where
A::Output: StreamSocket,
M: Accepted<Socket = A::Output>, { Server(A, <M as Accepted>::Seed), 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, <M as Accepted>::Seed)
Connection(M)
Methods
impl<M, A> Accept<M, A> where
A: TryAccept<Output = M::Socket> + Evented + Any,
M: Accepted,
[src]
A: TryAccept<Output = M::Socket> + Evented + Any,
M: Accepted,
fn new<S: GenericScope>(
sock: A,
seed: <M as Accepted>::Seed,
scope: &mut S
) -> Response<Self, Void>
sock: A,
seed: <M as Accepted>::Seed,
scope: &mut S
) -> Response<Self, Void>
Trait Implementations
impl<M, A> Machine for Accept<M, A> where
A: TryAccept<Output = M::Socket> + Evented + Any,
M: Accepted,
[src]
A: TryAccept<Output = M::Socket> + Evented + Any,
M: Accepted,
type Context = M::Context
Context type for the state machine Read more
type Seed = (A::Output, <M as Accepted>::Seed)
Seed is piece of data that is needed to initialize the machine Read more
fn create(
(sock, seed): Self::Seed,
scope: &mut Scope<Self::Context>
) -> Response<Self, Void>
(sock, seed): Self::Seed,
scope: &mut Scope<Self::Context>
) -> Response<Self, Void>
Create a machine from some data Read more
fn ready(
self,
events: EventSet,
scope: &mut Scope<Self::Context>
) -> Response<Self, Self::Seed>
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>
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>
) -> Response<Self, Self::Seed>
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