Struct async_h1::server::Server[][src]

pub struct Server<RW, F, Fut> { /* fields omitted */ }

struct for server

Implementations

impl<RW, F, Fut> Server<RW, F, Fut> where
    RW: Read + Write + Clone + Send + Sync + Unpin + 'static,
    F: Fn(Request) -> Fut,
    Fut: Future<Output = Result<Response>>, 
[src]

pub fn new(io: RW, endpoint: F) -> Self[src]

builds a new server

pub fn with_opts(self, opts: ServerOptions) -> Self[src]

with opts

pub async fn accept(&mut self) -> Result<()>[src]

accept in a loop

pub async fn accept_one(&mut self) -> Result<ConnectionStatus> where
    RW: Read + Write + Clone + Send + Sync + Unpin + 'static,
    F: Fn(Request) -> Fut,
    Fut: Future<Output = Result<Response>>, 
[src]

accept one request

Trait Implementations

impl<RW: Debug, F: Debug, Fut: Debug> Debug for Server<RW, F, Fut>[src]

Auto Trait Implementations

impl<RW, F, Fut> RefUnwindSafe for Server<RW, F, Fut> where
    F: RefUnwindSafe,
    Fut: RefUnwindSafe,
    RW: RefUnwindSafe

impl<RW, F, Fut> Send for Server<RW, F, Fut> where
    F: Send,
    Fut: Send,
    RW: Send

impl<RW, F, Fut> Sync for Server<RW, F, Fut> where
    F: Sync,
    Fut: Sync,
    RW: Sync

impl<RW, F, Fut> Unpin for Server<RW, F, Fut> where
    F: Unpin,
    Fut: Unpin,
    RW: Unpin

impl<RW, F, Fut> UnwindSafe for Server<RW, F, Fut> where
    F: UnwindSafe,
    Fut: UnwindSafe,
    RW: 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> From<T> for T[src]

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

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<V, T> VZip<V> for T where
    V: MultiLane<T>,