Struct spirit_hyper::HyperServer
source · pub struct HyperServer<Transport> { /* private fields */ }
Expand description
A ResourceConfig
for hyper servers.
This is a wrapper around a Transport
ResourceConfig
. It takes something that accepts
connections ‒ like TcpListen
and adds configuration specific for HTTP server.
This can then be paired with one of the ResourceConsumer
s created by server
functions to
spawn servers:
See also the HttpServer
type alias.
Configuration options
In addition to options already provided by the Transport
, these options are added:
http1-keepalive
: boolean, default true.http1-writev
: boolean, default true.http-mode
: One of"both"
,"http1-only"
or"http2-only"
. Defaults to"both"
.
Trait Implementations
sourceimpl<Transport, O, C, Action> CfgHelper<O, C, Action> for HyperServer<Transport>where
Self: ResourceConfig<O, C>,
Action: ResourceConsumer<Self, O, C>,
C: DeserializeOwned + Send + Sync + 'static,
O: Debug + StructOpt + Sync + Send + 'static,
impl<Transport, O, C, Action> CfgHelper<O, C, Action> for HyperServer<Transport>where
Self: ResourceConfig<O, C>,
Action: ResourceConsumer<Self, O, C>,
C: DeserializeOwned + Send + Sync + 'static,
O: Debug + StructOpt + Sync + Send + 'static,
sourceimpl<Transport: Clone> Clone for HyperServer<Transport>
impl<Transport: Clone> Clone for HyperServer<Transport>
sourcefn clone(&self) -> HyperServer<Transport>
fn clone(&self) -> HyperServer<Transport>
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresourceimpl<Transport: Debug> Debug for HyperServer<Transport>
impl<Transport: Debug> Debug for HyperServer<Transport>
sourceimpl<Transport: Default> Default for HyperServer<Transport>
impl<Transport: Default> Default for HyperServer<Transport>
sourceimpl<'de, Transport> Deserialize<'de> for HyperServer<Transport>where
Transport: Deserialize<'de>,
impl<'de, Transport> Deserialize<'de> for HyperServer<Transport>where
Transport: Deserialize<'de>,
sourcefn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
sourceimpl<Inner: ExtraCfgCarrier> ExtraCfgCarrier for HyperServer<Inner>
impl<Inner: ExtraCfgCarrier> ExtraCfgCarrier for HyperServer<Inner>
sourceimpl<Transport: Hash> Hash for HyperServer<Transport>
impl<Transport: Hash> Hash for HyperServer<Transport>
sourceimpl<Transport, O, C, Action> IteratedCfgHelper<O, C, Action> for HyperServer<Transport>where
Self: ResourceConfig<O, C>,
Action: ResourceConsumer<Self, O, C>,
C: DeserializeOwned + Send + Sync + 'static,
O: Debug + StructOpt + Sync + Send + 'static,
impl<Transport, O, C, Action> IteratedCfgHelper<O, C, Action> for HyperServer<Transport>where
Self: ResourceConfig<O, C>,
Action: ResourceConsumer<Self, O, C>,
C: DeserializeOwned + Send + Sync + 'static,
O: Debug + StructOpt + Sync + Send + 'static,
sourcefn apply<Extractor, ExtractedIter, Name>(
extractor: Extractor,
action: Action,
name: Name,
builder: Builder<O, C>
) -> Builder<O, C>where
Extractor: FnMut(&C) -> ExtractedIter + Send + 'static,
ExtractedIter: IntoIterator<Item = Self>,
Name: Clone + Display + Send + Sync + 'static,
fn apply<Extractor, ExtractedIter, Name>(
extractor: Extractor,
action: Action,
name: Name,
builder: Builder<O, C>
) -> Builder<O, C>where
Extractor: FnMut(&C) -> ExtractedIter + Send + 'static,
ExtractedIter: IntoIterator<Item = Self>,
Name: Clone + Display + Send + Sync + 'static,
Perform the transformation of the builder. Read more
sourceimpl<Transport: Ord> Ord for HyperServer<Transport>
impl<Transport: Ord> Ord for HyperServer<Transport>
sourcefn cmp(&self, other: &HyperServer<Transport>) -> Ordering
fn cmp(&self, other: &HyperServer<Transport>) -> Ordering
1.21.0 · sourcefn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
1.21.0 · sourcefn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
1.50.0 · sourcefn clamp(self, min: Self, max: Self) -> Selfwhere
Self: Sized + PartialOrd<Self>,
fn clamp(self, min: Self, max: Self) -> Selfwhere
Self: Sized + PartialOrd<Self>,
Restrict a value to a certain interval. Read more
sourceimpl<Transport: PartialEq> PartialEq<HyperServer<Transport>> for HyperServer<Transport>
impl<Transport: PartialEq> PartialEq<HyperServer<Transport>> for HyperServer<Transport>
sourcefn eq(&self, other: &HyperServer<Transport>) -> bool
fn eq(&self, other: &HyperServer<Transport>) -> bool
sourceimpl<Transport: PartialOrd> PartialOrd<HyperServer<Transport>> for HyperServer<Transport>
impl<Transport: PartialOrd> PartialOrd<HyperServer<Transport>> for HyperServer<Transport>
sourcefn partial_cmp(&self, other: &HyperServer<Transport>) -> Option<Ordering>
fn partial_cmp(&self, other: &HyperServer<Transport>) -> Option<Ordering>
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moresourceimpl<Inner, O, C> ResourceConfig<O, C> for HyperServer<Inner>where
Inner: ResourceConfig<O, C>,
impl<Inner, O, C> ResourceConfig<O, C> for HyperServer<Inner>where
Inner: ResourceConfig<O, C>,
type Seed = <Inner as ResourceConfig<O, C>>::Seed
type Seed = <Inner as ResourceConfig<O, C>>::Seed
The intermediate product that is cached. Read more
type Resource = <Inner as ResourceConfig<O, C>>::Resource
type Resource = <Inner as ResourceConfig<O, C>>::Resource
The final produced resource.
sourcefn create(&self, name: &str) -> Result<Self::Seed, Error>
fn create(&self, name: &str) -> Result<Self::Seed, Error>
The first stage of resource construction. Read more
sourcefn scaled(&self, name: &str) -> (usize, ValidationResults)
fn scaled(&self, name: &str) -> (usize, ValidationResults)
Returns how many instances of the resource should be present. Read more
impl<Transport: Eq> Eq for HyperServer<Transport>
impl<Transport> StructuralEq for HyperServer<Transport>
impl<Transport> StructuralPartialEq for HyperServer<Transport>
Auto Trait Implementations
impl<Transport> RefUnwindSafe for HyperServer<Transport>where
Transport: RefUnwindSafe,
impl<Transport> Send for HyperServer<Transport>where
Transport: Send,
impl<Transport> Sync for HyperServer<Transport>where
Transport: Sync,
impl<Transport> Unpin for HyperServer<Transport>where
Transport: Unpin,
impl<Transport> UnwindSafe for HyperServer<Transport>where
Transport: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
sourcefn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.