Struct std::sys_common::net::TcpStream
source · pub struct TcpStream {
inner: Socket,
}
Fields§
§inner: Socket
Implementations§
source§impl TcpStream
impl TcpStream
pub fn connect(addr: Result<&SocketAddr>) -> Result<TcpStream>
pub fn connect_timeout( addr: &SocketAddr, timeout: Duration ) -> Result<TcpStream>
pub fn socket(&self) -> &Socket
pub fn into_socket(self) -> Socket
pub fn set_read_timeout(&self, dur: Option<Duration>) -> Result<()>
pub fn set_write_timeout(&self, dur: Option<Duration>) -> Result<()>
pub fn read_timeout(&self) -> Result<Option<Duration>>
pub fn write_timeout(&self) -> Result<Option<Duration>>
pub fn peek(&self, buf: &mut [u8]) -> Result<usize>
pub fn read(&self, buf: &mut [u8]) -> Result<usize>
pub fn read_buf(&self, buf: BorrowedCursor<'_>) -> Result<()>
pub fn read_vectored(&self, bufs: &mut [IoSliceMut<'_>]) -> Result<usize>
pub fn is_read_vectored(&self) -> bool
pub fn write(&self, buf: &[u8]) -> Result<usize>
pub fn write_vectored(&self, bufs: &[IoSlice<'_>]) -> Result<usize>
pub fn is_write_vectored(&self) -> bool
pub fn peer_addr(&self) -> Result<SocketAddr>
pub fn socket_addr(&self) -> Result<SocketAddr>
pub fn shutdown(&self, how: Shutdown) -> Result<()>
pub fn duplicate(&self) -> Result<TcpStream>
pub fn set_linger(&self, linger: Option<Duration>) -> Result<()>
pub fn linger(&self) -> Result<Option<Duration>>
pub fn set_nodelay(&self, nodelay: bool) -> Result<()>
pub fn nodelay(&self) -> Result<bool>
pub fn set_ttl(&self, ttl: u32) -> Result<()>
pub fn ttl(&self) -> Result<u32>
pub fn take_error(&self) -> Result<Option<Error>>
pub fn set_nonblocking(&self, nonblocking: bool) -> Result<()>
Trait Implementations§
Auto Trait Implementations§
impl RefUnwindSafe for TcpStream
impl Send for TcpStream
impl Sync 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