[−][src]Struct spirit_hyper::BuildServer
A Transformation to turn a Builder into a Server.
The value wrapped in this shall be a closure taking:
- The
Builder - The configuration fragment (
HyperServer) - A
&strname - A
Receiver<()>.
It shall produce a server wrapped with a graceful shutdown. Technically, it can produce
whatever future that'll terminate once the Receiver contains something.
Constructing the server builder directly is a bit of a chore (bunch of cloning, lifetimes, and
it's something like 3rd-order function ‒ function that returns a function that returns a
function...). In many cases, the server_from_handler can help.
An instance of ServerBuilder goes inside.
Trait Implementations
impl<Tr, Inst, BS> Transformation<Builder<Acceptor<<Tr as Fragment>::Resource>, Exec>, Inst, HyperServer<Tr>> for BuildServer<BS> where
Tr: Fragment + Clone + Send + 'static,
Tr::Resource: Send,
BS: ServerBuilder<Tr> + Clone + Send + 'static,
BS::OutputFut: Future<Output = Result<(), HyperError>>, [src]
Tr: Fragment + Clone + Send + 'static,
Tr::Resource: Send,
BS: ServerBuilder<Tr> + Clone + Send + 'static,
BS::OutputFut: Future<Output = Result<(), HyperError>>,
type OutputResource = Activate<BS::OutputFut>
The type of resource after the transformation.
type OutputInstaller = FutureInstaller
The type of installer after the transformation. Read more
fn installer(&mut self, _ii: Inst, _name: &'static str) -> Self::OutputInstaller[src]
fn transform(
&mut self,
builder: Builder<Acceptor<Tr::Resource>>,
cfg: &HyperServer<Tr>,
name: &'static str
) -> Result<Self::OutputResource, AnyError>[src]
&mut self,
builder: Builder<Acceptor<Tr::Resource>>,
cfg: &HyperServer<Tr>,
name: &'static str
) -> Result<Self::OutputResource, AnyError>
Auto Trait Implementations
impl<BS> RefUnwindSafe for BuildServer<BS> where
BS: RefUnwindSafe,
BS: RefUnwindSafe,
impl<BS> Send for BuildServer<BS> where
BS: Send,
BS: Send,
impl<BS> Sync for BuildServer<BS> where
BS: Sync,
BS: Sync,
impl<BS> Unpin for BuildServer<BS> where
BS: Unpin,
BS: Unpin,
impl<BS> UnwindSafe for BuildServer<BS> where
BS: UnwindSafe,
BS: 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> Instrument for T[src]
fn instrument(self, span: Span) -> Instrumented<Self>[src]
fn in_current_span(self) -> Instrumented<Self>[src]
impl<T> Instrument for T[src]
fn instrument(self, span: Span) -> Instrumented<Self>[src]
fn in_current_span(self) -> Instrumented<Self>[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>,