#[non_exhaustive]pub struct HyperServer<Transport> {
pub transport: Transport,
pub hyper_cfg: HyperCfg,
}Expand description
A Fragment for hyper servers.
This is a wrapper around a Transport Fragment. It takes something that accepts
connections ‒ like TcpListen and adds configuration specific for a HTTP server.
The Fragment produces hyper Builder. The BuildServer transformation can be used to
make it into a Server and install it into a tokio runtime.
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.http-mode: One of"both","http1-only"or"http2-only". Defaults to"both".
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.transport: TransportThe inner transport.
This is accessible by the user in case it contains something of use to the
Transformations.
hyper_cfg: HyperCfgConfiguration of Hyper.
The HTTP configuration is inside this.
Trait Implementations§
Source§impl<Transport: Clone> Clone for HyperServer<Transport>
impl<Transport: Clone> Clone for HyperServer<Transport>
Source§fn clone(&self) -> HyperServer<Transport>
fn clone(&self) -> HyperServer<Transport>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<Transport: Comparable> Comparable for HyperServer<Transport>
impl<Transport: Comparable> Comparable for HyperServer<Transport>
Source§fn compare(&self, other: &Self) -> Comparison
fn compare(&self, other: &Self) -> Comparison
Compares two fragments.
Source§impl<Transport: Debug> Debug for HyperServer<Transport>
impl<Transport: Debug> Debug for HyperServer<Transport>
Source§impl<Transport: Default> Default for HyperServer<Transport>
impl<Transport: Default> Default for HyperServer<Transport>
Source§fn default() -> HyperServer<Transport>
fn default() -> HyperServer<Transport>
Returns the “default value” for a type. Read more
Source§impl<'de, Transport> Deserialize<'de> for HyperServer<Transport>where
Transport: Deserialize<'de>,
impl<'de, Transport> Deserialize<'de> for HyperServer<Transport>where
Transport: Deserialize<'de>,
Source§fn 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
Source§impl<Transport> Fragment for HyperServer<Transport>
impl<Transport> Fragment for HyperServer<Transport>
Source§type Driver = CacheSimilar<HyperServer<Transport>>
type Driver = CacheSimilar<HyperServer<Transport>>
The default driver to be used by the fragment. Read more
Source§type Installer = ()
type Installer = ()
The default installer to be used unless a transformation or the user doesn’t provide one. Read more
Source§type Seed = <Transport as Fragment>::Seed
type Seed = <Transport as Fragment>::Seed
The intermediate product if the fragment supports two-stage creation of
Resources. If not, it can be set to ().Source§type Resource = Builder<Acceptor<<Transport as Fragment>::Resource>>
type Resource = Builder<Acceptor<<Transport as Fragment>::Resource>>
The actual product this
Fragment creates.Source§fn make_seed(&self, name: &'static str) -> Result<Self::Seed, AnyError>
fn make_seed(&self, name: &'static str) -> Result<Self::Seed, AnyError>
Runs the first stage of creation. Read more
Source§fn make_resource(
&self,
seed: &mut Self::Seed,
name: &'static str,
) -> Result<Self::Resource, AnyError>
fn make_resource( &self, seed: &mut Self::Seed, name: &'static str, ) -> Result<Self::Resource, AnyError>
Runs the second stage of creation. Read more
Source§const RUN_BEFORE_CONFIG: bool = false
const RUN_BEFORE_CONFIG: bool = false
Configuration if the pipeline should be run once even before the config is loaded. Read more
Source§impl<Transport: Hash> Hash for HyperServer<Transport>
impl<Transport: Hash> Hash for HyperServer<Transport>
Source§impl<Transport: Ord> Ord for HyperServer<Transport>
impl<Transport: Ord> Ord for HyperServer<Transport>
Source§fn cmp(&self, other: &HyperServer<Transport>) -> Ordering
fn cmp(&self, other: &HyperServer<Transport>) -> Ordering
1.21.0 · Source§fn 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
Source§impl<Transport: PartialEq> PartialEq for HyperServer<Transport>
impl<Transport: PartialEq> PartialEq for HyperServer<Transport>
Source§impl<Transport: PartialOrd> PartialOrd for HyperServer<Transport>
impl<Transport: PartialOrd> PartialOrd for HyperServer<Transport>
Source§impl<Transport> Serialize for HyperServer<Transport>where
Transport: Serialize,
impl<Transport> Serialize for HyperServer<Transport>where
Transport: Serialize,
Source§impl<Transport> StructDoc for HyperServer<Transport>where
Transport: StructDoc,
impl<Transport> StructDoc for HyperServer<Transport>where
Transport: StructDoc,
Source§fn document() -> Documentation
fn document() -> Documentation
Returns the documentation for the type. Read more
Source§impl<Tr, Inst, BS> Transformation<Builder<Acceptor<<Tr as Fragment>::Resource>>, Inst, HyperServer<Tr>> for BuildServer<BS>
impl<Tr, Inst, BS> Transformation<Builder<Acceptor<<Tr as Fragment>::Resource>>, Inst, HyperServer<Tr>> for BuildServer<BS>
Source§type OutputResource = Activate<<BS as ServerBuilder<Tr>>::OutputFut>
type OutputResource = Activate<<BS as ServerBuilder<Tr>>::OutputFut>
The type of resource after the transformation.
Source§type OutputInstaller = FutureInstaller
type OutputInstaller = FutureInstaller
The type of installer after the transformation. Read more
impl<Transport: Eq> Eq for HyperServer<Transport>
impl<Transport> Stackable for HyperServer<Transport>where
Transport: Stackable,
impl<Transport> StructuralPartialEq for HyperServer<Transport>
Auto Trait Implementations§
impl<Transport> Freeze for HyperServer<Transport>where
Transport: Freeze,
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§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.