pub struct Connection { /* private fields */ }Expand description
A connection to another replica: one stream of messages each way.
Implementations§
Trait Implementations§
Source§impl Drop for Connection
impl Drop for Connection
Source§impl Transport for Connection
impl Transport for Connection
Source§fn receive(&mut self) -> Result<Vec<u8>, TransportError>
fn receive(&mut self) -> Result<Vec<u8>, TransportError>
Waits for the next message. Read more
Source§fn has_message(&mut self) -> bool
fn has_message(&mut self) -> bool
Whether
Transport::receive would return at once: the next message has arrived, or
the connection failed. A transport that cannot tell says no, which costs only speed:
a replica saves what it received before it waits (Holder::pause).Source§fn binding(&self) -> [u8; 32]
fn binding(&self) -> [u8; 32]
The 32 bytes exported from the connection’s encryption, the same on both sides of
this connection and on no other.
Source§fn own_endpoint(&self) -> [u8; 32]
fn own_endpoint(&self) -> [u8; 32]
This side’s endpoint ID.
Source§fn peer_endpoint(&self) -> [u8; 32]
fn peer_endpoint(&self) -> [u8; 32]
The other side’s endpoint ID, as the connection proved it.
Auto Trait Implementations§
impl Forget for Connection
impl Freeze for Connection
impl Move for Connection
impl RefUnwindSafe for Connection
impl Send for Connection
impl Sync for Connection
impl Unpin for Connection
impl UnsafeUnpin 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