pub trait Connection: Send {
// Required methods
fn recv(&mut self) -> BoxFut<'_, TransportResult<Option<Vec<u8>>>>;
fn send<'a>(
&'a mut self,
frame: &'a [u8],
) -> BoxFut<'a, TransportResult<()>>;
fn peer(&self) -> &PeerInfo;
}Expand description
A framed, bidirectional pipe — role-neutral (yielded by either
Listener::accept or Dialer::connect).
Required Methods§
Sourcefn recv(&mut self) -> BoxFut<'_, TransportResult<Option<Vec<u8>>>>
fn recv(&mut self) -> BoxFut<'_, TransportResult<Option<Vec<u8>>>>
Receive one logical frame. Ok(None) signals the peer closed.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".