[−][src]Struct dropshot::HttpServer
A thin wrapper around a Hyper Server object that exposes some interfaces that we find useful (e.g., close()). TODO-cleanup: this mechanism should probably do better with types. In particular, once you call run(), you shouldn't be able to call it again (i.e., it should consume self). But you should be able to close() it. Once you've called close(), you shouldn't be able to call it again.
Implementations
impl HttpServer
[src]
pub fn local_addr(&self) -> SocketAddr
[src]
pub fn close(self)
[src]
pub fn run(&mut self) -> JoinHandle<Result<(), Error>>
[src]
pub async fn wait_for_shutdown<'_>(
&'_ mut self,
join_handle: JoinHandle<Result<(), Error>>
) -> Result<(), String>
[src]
&'_ mut self,
join_handle: JoinHandle<Result<(), Error>>
) -> Result<(), String>
pub fn new(
config: &ConfigDropshot,
api: ApiDescription,
private: Arc<dyn Any + Send + Sync + 'static>,
log: &Logger
) -> Result<HttpServer, Error>
[src]
config: &ConfigDropshot,
api: ApiDescription,
private: Arc<dyn Any + Send + Sync + 'static>,
log: &Logger
) -> Result<HttpServer, Error>
Set up an HTTP server bound on the specified address that runs registered
handlers. You must invoke run()
on the returned instance of
HttpServer
(and await the result) to actually start the server. You
can call close()
to begin a graceful shutdown of the server, which will
be complete when the run()
Future is resolved.
TODO-cleanup We should be able to take a reference to the ApiDescription.
We currently can't because we need to hang onto the router.
pub fn app_private(&self) -> Arc<dyn Any + Send + Sync + 'static>
[src]
Auto Trait Implementations
impl !RefUnwindSafe for HttpServer
impl Send for HttpServer
impl !Sync for HttpServer
impl Unpin for HttpServer
impl !UnwindSafe for HttpServer
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,