[−][src]Struct spirit_tokio::handlers::PerConnection
A Transformation
that creates a new future from each accepted connection.
For each connection yielded from the acceptor (passed in as the input resource), the function
is used to create a new future. That new future is spawned into tokio
runtime. Note that
even when this resource gets uninstalled, the spawned futures from the connections are left
running.
In case the acceptor yields an error, it is dropped and not used any more. Note that some
primitives, like TcpListenWithLimits
handles errors
internally and never returns any, therefore it might be a good candidate for long-running
servers.
Examples
Trait Implementations
impl<F, Fut, A, II, SF> Transformation<A, II, SF> for PerConnection<F> where
A: Accept,
F: Clone + FnMut(A::Connection, &SF) -> Fut + 'static,
Fut: Future<Output = ()> + 'static,
SF: Clone + 'static,
[src]
A: Accept,
F: Clone + FnMut(A::Connection, &SF) -> Fut + 'static,
Fut: Future<Output = ()> + 'static,
SF: Clone + 'static,
type OutputResource = Acceptor<A, F, SF>
The type of resource after the transformation.
type OutputInstaller = FutureInstaller
The type of installer after the transformation. Read more
fn installer(&mut self, _: II, _: &str) -> FutureInstaller
[src]
fn transform(
&mut self,
accept: A,
cfg: &SF,
name: &'static str
) -> Result<Acceptor<A, F, SF>, AnyError>
[src]
&mut self,
accept: A,
cfg: &SF,
name: &'static str
) -> Result<Acceptor<A, F, SF>, AnyError>
Auto Trait Implementations
impl<F> RefUnwindSafe for PerConnection<F> where
F: RefUnwindSafe,
F: RefUnwindSafe,
impl<F> Send for PerConnection<F> where
F: Send,
F: Send,
impl<F> Sync for PerConnection<F> where
F: Sync,
F: Sync,
impl<F> Unpin for PerConnection<F> where
F: Unpin,
F: Unpin,
impl<F> UnwindSafe for PerConnection<F> where
F: UnwindSafe,
F: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> IntoResult<T> for T
[src]
impl<T, U> TryFrom<U> 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, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,