Struct spirit_hyper::HyperServer[][src]

#[non_exhaustive]pub struct HyperServer<Transport> {
    pub transport: Transport,
    pub hyper_cfg: HyperCfg,
}

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)

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: Transport

The inner transport.

This is accessible by the user in case it contains something of use to the Transformations.

hyper_cfg: HyperCfg

Configuration of Hyper.

The HTTP configuration is inside this.

Trait Implementations

impl<Transport: Clone> Clone for HyperServer<Transport>[src]

impl<Transport: Comparable> Comparable<HyperServer<Transport>> for HyperServer<Transport>[src]

impl<Transport: Debug> Debug for HyperServer<Transport>[src]

impl<Transport: Default> Default for HyperServer<Transport>[src]

impl<'de, Transport> Deserialize<'de> for HyperServer<Transport> where
    Transport: Deserialize<'de>, 
[src]

impl<Transport: Eq> Eq for HyperServer<Transport>[src]

impl<Transport> Fragment for HyperServer<Transport> where
    Transport: Fragment + Debug + Clone + Comparable
[src]

type Driver = CacheSimilar<Self>

The default driver to be used by the fragment. Read more

type Installer = ()

The default installer to be used unless a transformation or the user doesn’t provide one. Read more

type Seed = Transport::Seed

The intermediate product if the fragment supports two-stage creation of Resources. If not, it can be set to (). Read more

type Resource = Builder<Acceptor<Transport::Resource>>

The actual product this Fragment creates.

impl<Transport: Hash> Hash for HyperServer<Transport>[src]

impl<Transport: Ord> Ord for HyperServer<Transport>[src]

impl<Transport: PartialEq> PartialEq<HyperServer<Transport>> for HyperServer<Transport>[src]

impl<Transport: PartialOrd> PartialOrd<HyperServer<Transport>> for HyperServer<Transport>[src]

impl<Transport> Serialize for HyperServer<Transport> where
    Transport: Serialize
[src]

impl<Transport> Stackable for HyperServer<Transport> where
    Transport: Stackable
[src]

impl<Transport> StructDoc for HyperServer<Transport> where
    Transport: StructDoc
[src]

impl<Transport> StructuralEq for HyperServer<Transport>[src]

impl<Transport> StructuralPartialEq for HyperServer<Transport>[src]

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]

type OutputResource = Activate<BS::OutputFut>

The type of resource after the transformation.

type OutputInstaller = FutureInstaller

The type of installer after the transformation. Read more

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

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

impl<Q, K> Equivalent<K> for Q where
    K: Borrow<Q> + ?Sized,
    Q: Eq + ?Sized
[src]

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> IntoResult<T> for T[src]

impl<F> Optional for F where
    F: Stackable
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.