pub struct Connection<S: Stream> { /* private fields */ }Expand description
Connection with a stream that can be cloned if split into receiver and sender. Connection combines such stream for a specific destination address.
This connection type is used by FTCP and Brontide protocols.
Implementations§
Source§impl<S: Stream> Connection<S>
impl<S: Stream> Connection<S>
pub fn with(stream: TcpStream, remote_addr: InetSocketAddr) -> Self
Source§impl<const LEN_SIZE: usize> Connection<Stream<LEN_SIZE>>
impl<const LEN_SIZE: usize> Connection<Stream<LEN_SIZE>>
pub fn connect(inet_addr: InetSocketAddr) -> Result<Self, Error>
pub fn accept(listener: &TcpListener) -> Result<Self, Error>
Source§impl Connection<Stream>
impl Connection<Stream>
pub fn connect(inet_addr: InetSocketAddr) -> Result<Self, Error>
pub fn accept(listener: &TcpListener) -> Result<Self, Error>
Trait Implementations§
Auto Trait Implementations§
impl<S> Freeze for Connection<S>where
S: Freeze,
impl<S> RefUnwindSafe for Connection<S>where
S: RefUnwindSafe,
impl<S> Send for Connection<S>where
S: Send,
impl<S> Sync for Connection<S>where
S: Sync,
impl<S> Unpin for Connection<S>where
S: Unpin,
impl<S> UnwindSafe for Connection<S>where
S: UnwindSafe,
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