Struct pea2pea::connections::Connection
source · 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 purposes of the connection.
Implementations§
source§impl Connection
impl Connection
sourcepub const fn info(&self) -> &ConnectionInfo
pub const fn info(&self) -> &ConnectionInfo
Returns basic information associated with the connection.
sourcepub const fn addr(&self) -> SocketAddr
pub const fn addr(&self) -> SocketAddr
Returns the address associated with the connection.
sourcepub const fn side(&self) -> ConnectionSide
pub const fn side(&self) -> ConnectionSide
Returns Initiator
if the associated peer initiated the connection
and Responder
if the connection request was initiated by the node.
Auto Trait Implementations§
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