pub struct HttpServer<SV> { /* private fields */ }
Expand description
A helper struct for HTTP server with http modules embedded
Implementations§
Source§impl<SV> HttpServer<SV>
impl<SV> HttpServer<SV>
Sourcepub fn new_app(app: SV) -> Self
pub fn new_app(app: SV) -> Self
Create a new HttpServer with the given app which implements ServeHttp
Sourcepub fn add_module(&mut self, module: ModuleBuilder)
pub fn add_module(&mut self, module: ModuleBuilder)
Add ModuleBuilder to this HttpServer
Trait Implementations§
Source§impl<SV> HttpServerApp for HttpServer<SV>
impl<SV> HttpServerApp for HttpServer<SV>
Source§fn process_new_http<'life0, 'life1, 'async_trait>(
self: &'life0 Arc<Self>,
http: ServerSession,
shutdown: &'life1 ShutdownWatch,
) -> Pin<Box<dyn Future<Output = Option<Stream>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn process_new_http<'life0, 'life1, 'async_trait>(
self: &'life0 Arc<Self>,
http: ServerSession,
shutdown: &'life1 ShutdownWatch,
) -> Pin<Box<dyn Future<Output = Option<Stream>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Source§fn h2_options(&self) -> Option<H2Options>
fn h2_options(&self) -> Option<H2Options>
Provide options on how HTTP/2 connection should be established. This function will be called
every time a new HTTP/2 connection needs to be established. Read more
Source§fn server_options(&self) -> Option<&HttpServerOptions>
fn server_options(&self) -> Option<&HttpServerOptions>
Provide HTTP server options used to override default behavior. This function will be called
every time a new connection is processed. Read more
fn http_cleanup<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
Auto Trait Implementations§
impl<SV> !Freeze for HttpServer<SV>
impl<SV> !RefUnwindSafe for HttpServer<SV>
impl<SV> Send for HttpServer<SV>where
SV: Send,
impl<SV> Sync for HttpServer<SV>where
SV: Sync,
impl<SV> Unpin for HttpServer<SV>where
SV: Unpin,
impl<SV> !UnwindSafe for HttpServer<SV>
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