pub struct ConnectionState(/* private fields */);
Expand description
A handle for the state of a connection established with either Connection::connect
or
Connection::accept
. Use this to get notified when the connection has been closed without
needing to hold on to the Socket end.
Implementations§
Source§impl ConnectionState
impl ConnectionState
Sourcepub async fn wait_for_close(self) -> Result<(), Error>
pub async fn wait_for_close(self) -> Result<(), Error>
Wait for this connection to close. Returns Ok(()) if the connection was closed without error, and an error if it closed because of an error.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ConnectionState
impl !RefUnwindSafe for ConnectionState
impl Send for ConnectionState
impl Sync for ConnectionState
impl Unpin for ConnectionState
impl !UnwindSafe for ConnectionState
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