Struct pea2pea::connections::Connection [−][src]
pub struct Connection {
pub addr: SocketAddr,
pub reader: Option<OwnedReadHalf>,
pub writer: Option<OwnedWriteHalf>,
pub tasks: Vec<JoinHandle<()>>,
pub side: ConnectionSide,
}
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.
Fields
addr: SocketAddr
The address of the connection.
reader: Option<OwnedReadHalf>
Kept only until the protocols are enabled (Reading
should take()
it).
writer: Option<OwnedWriteHalf>
Kept only until the protocols are enabled (Writing
should take()
it).
tasks: Vec<JoinHandle<()>>
Handles to tasks spawned for the connection.
side: ConnectionSide
The connection’s side in relation to the node.
Implementations
Provides mutable access to the underlying reader; it should only be used in protocol definitions.
Provides mutable access to the underlying writer; it should only be used in protocol definitions.
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
Mutably borrows from an owned value. Read more
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more