pub struct Connection { /* private fields */ }
Expand description
Created for each active connection; used by the protocols to obtain a handle for reading and writing, and keeps track of tasks that have been spawned for the connection.
Implementations§
Source§impl Connection
impl Connection
Sourcepub fn addr(&self) -> SocketAddr
pub fn addr(&self) -> SocketAddr
Returns the address associated with the connection.
Sourcepub fn side(&self) -> ConnectionSide
pub fn side(&self) -> ConnectionSide
Returns ConnectionSide::Initiator
if the associated peer initiated the connection
and ConnectionSide::Responder
if the connection request was initiated by Tcp.
Auto Trait Implementations§
impl !Freeze for Connection
impl !RefUnwindSafe for Connection
impl Send for Connection
impl Sync for Connection
impl Unpin for Connection
impl !UnwindSafe for Connection
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