pub struct Handle { /* private fields */ }
Expand description
A handle for Server
.
Implementations§
source§impl Handle
impl Handle
sourcepub fn connection_count(&self) -> usize
pub fn connection_count(&self) -> usize
Get the number of connections.
sourcepub fn graceful_shutdown(&self, duration: Option<Duration>)
pub fn graceful_shutdown(&self, duration: Option<Duration>)
Gracefully shutdown the server.
None
means indefinite grace period.
sourcepub async fn listening(&self) -> Option<SocketAddr>
pub async fn listening(&self) -> Option<SocketAddr>
Returns local address and port when server starts listening.
Returns None
if server fails to bind.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Handle
impl RefUnwindSafe for Handle
impl Send for Handle
impl Sync for Handle
impl Unpin for Handle
impl UnwindSafe for Handle
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§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)