pub struct UnsupervisedHttpServer<S> { /* private fields */ }Expand description
An HTTP server that spawns and manages itself.
§Deprecated
Callers should generally prefer to use HttpServer, as it is designed to run under supervision and play nicely
with supervision trees: graceful shutdown, spawning of connection handlers in the right place, etc.
Implementations§
Source§impl<S> UnsupervisedHttpServer<S>
impl<S> UnsupervisedHttpServer<S>
Sourcepub fn from_listener(listener: ConnectionOrientedListener, service: S) -> Self
pub fn from_listener(listener: ConnectionOrientedListener, service: S) -> Self
Creates a new UnsupervisedHttpServer from the given listener and service.
§Panics
This will panic if called outside the context of a Tokio runtime.
Sourcepub fn with_tls_config(self, config: ServerConfig) -> Self
pub fn with_tls_config(self, config: ServerConfig) -> Self
Sets the TLS configuration for the server.
This will enable TLS for the server, and the server will only accept connections that are encrypted with TLS.
Defaults to TLS being disabled.
Sourcepub fn with_executor(self, executor: Handle) -> Self
pub fn with_executor(self, executor: Handle) -> Self
Sets the executor for the server.
This executor will be used for spawning tasks to handle incoming connections, but not for the spawn that accepts new connections.
Defaults to the current Tokio runtime at the time from_listener is called.
Source§impl<S, B> UnsupervisedHttpServer<S>
impl<S, B> UnsupervisedHttpServer<S>
Sourcepub fn listen(self) -> (ShutdownCoordinator, ErrorHandle)
pub fn listen(self) -> (ShutdownCoordinator, ErrorHandle)
Starts the server and listens for incoming connections.
Returns two handles: one for shutting down the server, and one for receiving any errors that occur while the server is running.
Auto Trait Implementations§
impl<S> !Freeze for UnsupervisedHttpServer<S>
impl<S> !RefUnwindSafe for UnsupervisedHttpServer<S>
impl<S> Send for UnsupervisedHttpServer<S>where
S: Send,
impl<S> Sync for UnsupervisedHttpServer<S>where
S: Sync,
impl<S> Unpin for UnsupervisedHttpServer<S>where
S: Unpin,
impl<S> !UnwindSafe for UnsupervisedHttpServer<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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::RequestSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> Track for T
impl<T> Track for T
Source§fn track_resources(self, token: ResourceGroupToken) -> Tracked<Self>
fn track_resources(self, token: ResourceGroupToken) -> Tracked<Self>
Tracked wrapper. Read moreSource§fn in_current_resource_group(self) -> Tracked<Self>
fn in_current_resource_group(self) -> Tracked<Self>
Tracked wrapper. Read more