[][src]Struct spirit_tokio::handlers::HandleListenerInit

pub struct HandleListenerInit<I, F>(pub I, pub F);

A handler of incoming connections with per-listener initialization.

This is a more complex version of the HandleListener. This one contains two closures. The first one (I) is called for each listening socket and produces an arbitrary context. The second one (F) is called for each connection accepted on that listening socket. The context is provided to the closure.

This approach allows certain initialization to happen for each separate listening socket.

Trait Implementations

impl<I: Clone, F: Clone> Clone for HandleListenerInit<I, F>[src]

fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

impl<I: Debug, F: Debug> Debug for HandleListenerInit<I, F>[src]

impl<Listener, InputInstaller, SubFragment, I, Ctx, F, Fut> Transformation<Listener, InputInstaller, SubFragment> for HandleListenerInit<I, F> where
    Listener: IntoIncoming,
    I: FnMut(&mut Listener, &SubFragment) -> Result<Ctx, Error>,
    F: Fn(Listener::Connection, &mut Ctx) -> Fut + Clone + 'static,
    Fut: IntoFuture<Item = ()>,
    Fut::Error: Into<Error>,
    SubFragment: Debug,
    Ctx: 'static, 
[src]

type OutputResource = Acceptor<Listener::Incoming, Ctx, F>

The type of resource after the transformation.

type OutputInstaller = FutureInstaller<Self::OutputResource>

The type of installer after the transformation. Read more

Auto Trait Implementations

impl<I, F> Send for HandleListenerInit<I, F> where
    F: Send,
    I: Send

impl<I, F> Sync for HandleListenerInit<I, F> where
    F: Sync,
    I: Sync

Blanket Implementations

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> From for T[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> IntoResult for T[src]

impl<T> Erased for T