BuildServer

Struct BuildServer 

Source
pub struct BuildServer<BS>(pub BS);
Expand description

A Transformation to turn a Builder into a Server.

The value wrapped in this shall be a closure taking:

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.

Tuple Fields§

§0: BS

Trait Implementations§

Source§

impl<Tr, Inst, BS> Transformation<Builder<Acceptor<<Tr as Fragment>::Resource>>, 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<(), Error>>,

Source§

type OutputResource = Activate<<BS as ServerBuilder<Tr>>::OutputFut>

The type of resource after the transformation.
Source§

type OutputInstaller = FutureInstaller

The type of installer after the transformation. Read more
Source§

fn installer(&mut self, _ii: Inst, _name: &'static str) -> Self::OutputInstaller

Creates the installer. Read more
Source§

fn transform( &mut self, builder: Builder<Acceptor<Tr::Resource>>, cfg: &HyperServer<Tr>, name: &'static str, ) -> Result<Self::OutputResource, AnyError>

Transforms one instance of the resource. Read more

Auto Trait Implementations§

§

impl<BS> Freeze for BuildServer<BS>
where BS: Freeze,

§

impl<BS> RefUnwindSafe for BuildServer<BS>
where BS: RefUnwindSafe,

§

impl<BS> Send for BuildServer<BS>
where BS: Send,

§

impl<BS> Sync for BuildServer<BS>
where BS: Sync,

§

impl<BS> Unpin for BuildServer<BS>
where BS: Unpin,

§

impl<BS> UnwindSafe for BuildServer<BS>
where BS: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoResult<T> for T

Source§

fn into_result(self) -> Result<T, Box<dyn Error + Sync + Send>>

Turns self into the result.
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.