[−][src]Struct spirit_tokio::handlers::PerConnectionInit
A more flexible (and mind-bending) version of PerConnection
.
The PerConnection
applies a closure to each accepted connection. To share the closure
between all listeners, the closure is cloned.
This version's closure is higher-level closure. It is called once for each listener to produce a per-listener closure to handle its connections. In effect, it allows for custom „cloning“ of the closure.
Trait Implementations
impl<FA, FC, Fut, A, II, SF> Transformation<A, II, SF> for PerConnectionInit<FA> where
A: Accept,
FA: FnMut(&A, &SF) -> FC + 'static,
FC: FnMut(A::Connection, &SF) -> Fut + 'static,
Fut: Future<Output = ()> + 'static,
SF: Clone + 'static,
[src]
A: Accept,
FA: FnMut(&A, &SF) -> FC + 'static,
FC: FnMut(A::Connection, &SF) -> Fut + 'static,
Fut: Future<Output = ()> + 'static,
SF: Clone + 'static,
type OutputResource = Acceptor<A, FC, 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, FC, SF>, AnyError>
[src]
&mut self,
accept: A,
cfg: &SF,
name: &'static str
) -> Result<Acceptor<A, FC, SF>, AnyError>
Auto Trait Implementations
impl<F> RefUnwindSafe for PerConnectionInit<F> where
F: RefUnwindSafe,
F: RefUnwindSafe,
impl<F> Send for PerConnectionInit<F> where
F: Send,
F: Send,
impl<F> Sync for PerConnectionInit<F> where
F: Sync,
F: Sync,
impl<F> Unpin for PerConnectionInit<F> where
F: Unpin,
F: Unpin,
impl<F> UnwindSafe for PerConnectionInit<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>,