pub struct HttpServer<Request, Response, S>where
Request: RequestHttpConvert<Request> + Clone + Send,
Response: ResponseHttpConvert<Request, Response>,
S: Service<Request, Response = ServiceResponse<Response>, Error = Box<dyn Error + Sync + Send>, Future = Pin<Box<dyn Future<Output = Result<ServiceResponse<Response>, Box<dyn Error + Sync + Send>>> + Send>>> + Send + Clone + 'static,{ /* private fields */ }
Expand description
Server for HTTP communication with remote clients.
Implementations§
Source§impl<Request, Response, S> HttpServer<Request, Response, S>where
Request: RequestHttpConvert<Request> + Clone + Send + 'static,
Response: ResponseHttpConvert<Request, Response> + Send + 'static,
S: Service<Request, Response = ServiceResponse<Response>, Error = Box<dyn Error + Sync + Send>, Future = Pin<Box<dyn Future<Output = Result<ServiceResponse<Response>, Box<dyn Error + Sync + Send>>> + Send>>> + Send + Clone + 'static,
impl<Request, Response, S> HttpServer<Request, Response, S>where
Request: RequestHttpConvert<Request> + Clone + Send + 'static,
Response: ResponseHttpConvert<Request, Response> + Send + 'static,
S: Service<Request, Response = ServiceResponse<Response>, Error = Box<dyn Error + Sync + Send>, Future = Pin<Box<dyn Future<Output = Result<ServiceResponse<Response>, Box<dyn Error + Sync + Send>>> + Send>>> + Send + Clone + 'static,
Sourcepub fn new(
service: S,
config: HttpServerConfig,
) -> HttpServer<Request, Response, S>
pub fn new( service: S, config: HttpServerConfig, ) -> HttpServer<Request, Response, S>
Creates a new client for HTTP communication. Client requests will be
converted and forwarded to the service
.
Auto Trait Implementations§
impl<Request, Response, S> Freeze for HttpServer<Request, Response, S>where
S: Freeze,
impl<Request, Response, S> RefUnwindSafe for HttpServer<Request, Response, S>
impl<Request, Response, S> Send for HttpServer<Request, Response, S>where
Response: Send,
impl<Request, Response, S> Sync for HttpServer<Request, Response, S>
impl<Request, Response, S> Unpin for HttpServer<Request, Response, S>
impl<Request, Response, S> UnwindSafe for HttpServer<Request, Response, S>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more