[−][src]Struct spirit_tokio::handlers::HandleListener
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(&self) -> 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]
Listener: IntoIncoming,
F: Fn(Listener::Connection, &SubFragment) -> Fut + Clone + 'static,
Fut: IntoFuture<Item = ()>,
Fut::Error: Into<Error>,
SubFragment: Clone + Debug + 'static,
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
fn installer(&mut self, _: InputInstaller, name: &str) -> Self::OutputInstaller
[src]
fn transform(
&mut self,
listener: Listener,
cfg: &SubFragment,
name: &'static str
) -> Result<Self::OutputResource, Error>
[src]
&mut self,
listener: Listener,
cfg: &SubFragment,
name: &'static str
) -> Result<Self::OutputResource, Error>
Auto Trait Implementations
impl<F> Send for HandleListener<F> where
F: Send,
F: Send,
impl<F> Sync for HandleListener<F> where
F: Sync,
F: Sync,
Blanket Implementations
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From for T
[src]
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,