Enum Accept

Source
pub enum Accept<M, A: TryAccept + Sized>
where A::Output: StreamSocket, M: Accepted<Socket = A::Output>,
{ Server(A, <M as Accepted>::Seed), Connection(M), }
Expand description

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)

Implementations§

Source§

impl<M, A> Accept<M, A>
where A: TryAccept<Output = M::Socket> + Evented + Any, M: Accepted,

Source

pub fn new<S: GenericScope>( sock: A, seed: <M as Accepted>::Seed, scope: &mut S, ) -> Response<Self, Void>

Trait Implementations§

Source§

impl<M, A> Machine for Accept<M, A>
where A: TryAccept<Output = M::Socket> + Evented + Any, M: Accepted,

Source§

type Context = <M as Machine>::Context

Context type for the state machine Read more
Source§

type Seed = (<A as TryAccept>::Output, <M as Accepted>::Seed)

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

fn create( (sock, seed): Self::Seed, scope: &mut Scope<'_, Self::Context>, ) -> Response<Self, Void>

Create a machine from some data Read more
Source§

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

Socket readiness notification
Source§

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

Called after spawn event Read more
Source§

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

Timeout happened
Source§

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

Message received Read more
Source§

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

Auto Trait Implementations§

§

impl<M, A> Freeze for Accept<M, A>
where <A as TryAccept>::Output: Sized, A: Freeze, <M as Accepted>::Seed: Freeze, M: Freeze,

§

impl<M, A> RefUnwindSafe for Accept<M, A>

§

impl<M, A> Send for Accept<M, A>
where <A as TryAccept>::Output: Sized, A: Send, <M as Accepted>::Seed: Send, M: Send,

§

impl<M, A> Sync for Accept<M, A>
where <A as TryAccept>::Output: Sized, A: Sync, <M as Accepted>::Seed: Sync, M: Sync,

§

impl<M, A> Unpin for Accept<M, A>
where <A as TryAccept>::Output: Sized, A: Unpin, <M as Accepted>::Seed: Unpin, M: Unpin,

§

impl<M, A> UnwindSafe for Accept<M, A>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.