Struct trillium_testing::ServerHandle
pub struct ServerHandle { /* private fields */ }
Expand description
A handle for a spawned trillium server. Returned by
[Config::handle
][crate::Config::handle] and
[Config::spawn
][crate::Config::spawn]
Implementations§
§impl ServerHandle
impl ServerHandle
pub async fn stop(&self)
pub async fn stop(&self)
stop server and wait for it to shut down gracefully
pub fn stopper(&self) -> Stopper
pub fn stopper(&self) -> Stopper
retrieves a clone of the [Stopper
] used by this server
pub fn observer(&self) -> CloneCounterObserver
pub fn observer(&self) -> CloneCounterObserver
retrieves a [CloneCounterObserver
] which can be used to
monitor or modify the number of outstanding connections for
the purposes of graceful shutdown.
pub fn is_running(&self) -> bool
pub fn is_running(&self) -> bool
checks whether this server has shut down. It’s preferable to await
this ServerHandle
instead of polling this.
Trait Implementations§
§impl Clone for ServerHandle
impl Clone for ServerHandle
§fn clone(&self) -> ServerHandle
fn clone(&self) -> ServerHandle
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read more§impl Debug for ServerHandle
impl Debug for ServerHandle
§impl IntoFuture for ServerHandle
impl IntoFuture for ServerHandle
§type IntoFuture = CompletionFuture
type IntoFuture = CompletionFuture
Which kind of future are we turning this into?
§fn into_future(self) -> <ServerHandle as IntoFuture>::IntoFuture
fn into_future(self) -> <ServerHandle as IntoFuture>::IntoFuture
Creates a future from a value. Read more
Auto Trait Implementations§
impl Freeze for ServerHandle
impl RefUnwindSafe for ServerHandle
impl Send for ServerHandle
impl Sync for ServerHandle
impl Unpin for ServerHandle
impl UnwindSafe for ServerHandle
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)