pub struct TcpStream { /* private fields */ }Expand description
RAII wrapper around a TCP (stream) socket.
Uses inline storage for the socket backend, so no heap/zero-heap split is
needed. The handle is derived from &self.storage at each call to
avoid dangling self-referential pointers after Rust moves the struct.
Implementations§
Source§impl TcpStream
impl TcpStream
Sourcepub fn connect(&self, addr: &Address, timeout_ms: u32) -> Result<()>
pub fn connect(&self, addr: &Address, timeout_ms: u32) -> Result<()>
Connect to a remote address with a timeout.
§Errors
Returns an error if the connection fails or times out.
Trait Implementations§
impl Send for TcpStream
impl Sync for TcpStream
Auto Trait Implementations§
impl Freeze for TcpStream
impl RefUnwindSafe for TcpStream
impl Unpin for TcpStream
impl UnwindSafe for TcpStream
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