Struct pea2pea::connections::Connection [−][src]
pub struct Connection { pub node: Node, pub addr: SocketAddr, pub reader: Option<OwnedReadHalf>, pub writer: Option<OwnedWriteHalf>, pub tasks: Vec<JoinHandle<()>>, pub outbound_message_sender: Option<Sender<Bytes>>, pub side: ConnectionSide, }
Expand description
Keeps track of tasks that have been spawned for the purposes of a connection; it
also contains a sender that communicates with the Writing
protocol handler.
Fields
node: Node
A reference to the owning node.
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 by the connection.
outbound_message_sender: Option<Sender<Bytes>>
Used to queue writes to the stream.
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.
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for Connection
impl Send for Connection
impl Sync for Connection
impl Unpin for Connection
impl !UnwindSafe for Connection