Trait Accepted

Source
pub trait Accepted: Machine {
    type Seed: Clone;
    type Socket: StreamSocket;

    // Required method
    fn accepted(
        sock: Self::Socket,
        seed: <Self as Accepted>::Seed,
        scope: &mut Scope<'_, Self::Context>,
    ) -> Response<Self, Void>;
}
Expand description

Trait which must be implemented for a state machine to accept connection

This basically provides alternative constructor for the state machine.

Required Associated Types§

Required Methods§

Source

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

The constructor of the state machine from the accepted connection

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<P: Protocol> Accepted for Stream<P>
where <P as Protocol>::Seed: Clone,