[][src]Struct spirit_tokio::handlers::HandleListener

pub struct HandleListener<F>(pub F);

A handler newtype to handle each separate connection.

If this handler is used (wrapping a closure taking the connection and the Fragment that created the relevant listening socket it comes from), the closure is called for already accepted connection. It shall produce a future and that future is spawned onto a runtime.

Most of the time this is what you want if you just want to serve some requests over TCP or something similar that has accepting semantics (one socket that listens and produces more sockets).

For slightly more complex situation, you might want to also consider the HandleListenerInit.

Trait Implementations

impl<F: Clone> Clone for HandleListener<F>[src]

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

Performs copy-assignment from source. Read more

impl<F: Debug> Debug for HandleListener<F>[src]

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

type OutputResource = Acceptor<Listener::Incoming, SubFragment, ConfigAdaptor<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<F> Send for HandleListener<F> where
    F: Send

impl<F> Sync for HandleListener<F> where
    F: 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