Struct TcpStream
pub struct TcpStream { pub(in ::sys::net::connection::socket) inner: Socket }
Fields
inner: Socket
Implementations
impl TcpStream
fn connect<A: ToSocketAddrs>(addr: A) -> Result<TcpStream>fn connect_timeout(addr: &SocketAddr, timeout: Duration) -> Result<TcpStream>fn socket(&self) -> &Socketfn into_socket(self) -> Socketfn set_read_timeout(&self, dur: Option<Duration>) -> Result<()>fn set_write_timeout(&self, dur: Option<Duration>) -> Result<()>fn read_timeout(&self) -> Result<Option<Duration>>fn write_timeout(&self) -> Result<Option<Duration>>fn peek(&self, buf: &mut [u8]) -> Result<usize>fn read(&self, buf: &mut [u8]) -> Result<usize>fn read_buf(&self, buf: BorrowedCursor<'_, u8>) -> Result<()>fn read_vectored(&self, bufs: &mut [IoSliceMut<'_>]) -> Result<usize>fn is_read_vectored(&self) -> boolfn write(&self, buf: &[u8]) -> Result<usize>fn write_vectored(&self, bufs: &[IoSlice<'_>]) -> Result<usize>fn is_write_vectored(&self) -> boolfn peer_addr(&self) -> Result<SocketAddr>fn socket_addr(&self) -> Result<SocketAddr>fn shutdown(&self, how: Shutdown) -> Result<()>fn duplicate(&self) -> Result<TcpStream>fn set_linger(&self, linger: Option<Duration>) -> Result<()>fn linger(&self) -> Result<Option<Duration>>fn set_keepalive(&self, keepalive: bool) -> Result<()>fn keepalive(&self) -> Result<bool>fn set_nodelay(&self, nodelay: bool) -> Result<()>fn nodelay(&self) -> Result<bool>fn set_ttl(&self, ttl: u32) -> Result<()>fn ttl(&self) -> Result<u32>fn take_error(&self) -> Result<Option<Error>>fn set_nonblocking(&self, nonblocking: bool) -> Result<()>
Trait Implementations
impl AsInner<Socket> for TcpStream
fn as_inner(&self) -> &Socket
impl Debug for TcpStream
fn fmt(&self, f: &mut Formatter<'_>) -> Result
impl FromInner<Socket> for TcpStream
fn from_inner(socket: Socket) -> TcpStream
Auto Trait Implementations
impl Freeze for TcpStream
impl RefUnwindSafe for TcpStream
impl Send for TcpStream
impl Sync for TcpStream
impl Unpin for TcpStream
impl UnsafeUnpin for TcpStream
impl UnwindSafe for TcpStream
Blanket Implementations
impl<T> Any for TcpStream
where
T: 'static + ?Sized,
fn type_id(&self) -> TypeId
impl<T> Borrow<T> for TcpStream
where
T: ?Sized,
fn borrow(&self) -> &T
impl<T> BorrowMut<T> for TcpStream
where
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
impl<T> From<T> for TcpStream
fn from(t: T) -> TReturns the argument unchanged.
impl<T> SizeHint for TcpStream
where
T: ?Sized,
fn lower_bound(&self) -> usizefn upper_bound(&self) -> Option<usize>
impl<T> SizedTypeProperties for TcpStream
impl<T, U> Into<U> for TcpStream
where
U: From<T>,
fn into(self) -> UCalls
U::from(self).That is, this conversion is whatever the implementation of
[From]<T> for Uchooses to do.
impl<T, U> TryFrom<U> for TcpStream
where
U: Into<T>,
type Error = Infallible;fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
impl<T, U> TryInto<U> for TcpStream
where
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error;fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>