pub struct ServerHandle { /* private fields */ }Expand description
Handle for explicit graceful shutdown of a spawned server.
Dropping the handle broadcasts shutdown and aborts the listener task so a
forgotten handle cannot detach a server indefinitely. Call Self::shutdown
when graceful, awaitable completion is required.
Implementations§
Source§impl ServerHandle
impl ServerHandle
pub fn local_addr(&self) -> SocketAddr
pub async fn shutdown(self) -> Result<(), ServerError>
Trait Implementations§
Source§impl Drop for ServerHandle
impl Drop for ServerHandle
Auto Trait Implementations§
impl Freeze for ServerHandle
impl RefUnwindSafe for ServerHandle
impl Send for ServerHandle
impl Sync for ServerHandle
impl Unpin for ServerHandle
impl UnsafeUnpin 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