[][src]Struct hreq::server::Server

pub struct Server<State> { /* fields omitted */ }

Implementations

impl Server<()>[src]

pub fn new() -> Server<()>[src]

Create a server without a state.

impl<State> Server<State> where
    State: Clone + Unpin + Send + Sync + 'static, 
[src]

pub fn with_state(state: State) -> Self[src]

Create a server over a provided state.

pub fn state(&self) -> State[src]

pub fn at(&mut self, path: &str) -> Route<State>[src]

pub async fn listen<'_>(
    &'_ self,
    port: u16
) -> Result<(ServerHandle, SocketAddr), Error>
[src]

pub async fn listen_tls<'_>(
    &'_ self,
    port: u16,
    tls: ServerConfig
) -> Result<(ServerHandle, SocketAddr), Error>
[src]

pub async fn handle<B: Into<Body>, '_>(
    &'_ self,
    req: Request<B>
) -> Result<Response<Body>, Error>
[src]

Trait Implementations

impl<State: Clone> Clone for Server<State>[src]

Auto Trait Implementations

impl<State> !RefUnwindSafe for Server<State>

impl<State> Send for Server<State> where
    State: Send + Sync

impl<State> Sync for Server<State> where
    State: Send + Sync

impl<State> Unpin for Server<State>

impl<State> !UnwindSafe for Server<State>

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> 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> Sealed<T> for T where
    T: ?Sized

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.

impl<T> WithSubscriber for T[src]