[][src]Struct http_io::server::HttpServer

pub struct HttpServer<L: Listen, H: HttpRequestHandler<L::stream>> { /* fields omitted */ }

A simple HTTP server. Not suited for production workloads, better used in tests and small projects.

Methods

impl<L: Listen, H: HttpRequestHandler<L::stream>> HttpServer<L, H>[src]

pub fn new(connection_stream: L, request_handler: H) -> Self[src]

pub fn serve_one(&self) -> Result<()>[src]

Accept one new HTTP stream and serve one request off it.

pub fn serve_forever(&self) -> ![src]

Run serve_one in a loop forever

Auto Trait Implementations

impl<L, H> Send for HttpServer<L, H> where
    H: Send,
    L: Send

impl<L, H> Sync for HttpServer<L, H> where
    H: Sync,
    L: Sync

Blanket Implementations

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

impl<T> From for T[src]

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

type Error = Infallible

The type returned in the event of a conversion error.

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

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

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

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

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

The type returned in the event of a conversion error.