[][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]

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, AnyError>,
    F: Fn(Listener::Connection, &mut Ctx) -> Fut + Clone + 'static,
    Fut: IntoFuture<Item = ()>,
    Fut::Error: Into<AnyError>,
    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

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

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

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

Blanket Implementations

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

impl<T> From<T> for T[src]

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

type Owned = T

The resulting type after obtaining ownership.

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

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> 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> Borrow<T> for T where
    T: ?Sized
[src]

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

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

impl<T> IntoResult<T> for T[src]