[][src]Function http_async::server

pub async fn server<Address, Data, Handler>(
    address: Address,
    this: Arc<Data>,
    handler: Arc<Handler>
) -> Result<(), Error> where
    Address: ToSocketAddrs + Display + Send + Sync + Clone + 'static,
    Data: Send + Sync + 'static,
    Handler: Send + Sync + 'static + Fn(Request, Arc<Data>) -> Response

Creates a Future to start a Hyper Text Transfer Protocol Server.

Arguments

  • address – server binds to this address,
  • this – some data, that will be passed to handler everytime, someone connects,
  • handler – handler for Hyper Text Transfer Protocol Requests.