pub struct Conn {
pub reader: Box<dyn Read + Send>,
pub writer: Box<dyn Write + Send>,
pub peer_closed: Arc<dyn Fn() -> bool + Send + Sync>,
pub shutdown: Arc<dyn Fn() + Send + Sync>,
pub peer: PeerIdentity,
}Expand description
An accepted or connected duplex stream. peer is who the OS reports on the other end.
Fields§
§reader: Box<dyn Read + Send>§writer: Box<dyn Write + Send>§peer_closed: Arc<dyn Fn() -> bool + Send + Sync>Non-blocking: has the peer closed its end? Safe to call from another thread.
shutdown: Arc<dyn Fn() + Send + Sync>§peer: PeerIdentityWho the OS says is on the other end. Filled in for an accepted connection, where the peer check has just run; empty for a connection this process opened.
Auto Trait Implementations§
impl !RefUnwindSafe for Conn
impl !Sync for Conn
impl !UnwindSafe for Conn
impl Freeze for Conn
impl Send for Conn
impl Unpin for Conn
impl UnsafeUnpin for Conn
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