pub struct TcpStream {
inner: Socket,
}Fields§
§inner: SocketImplementations§
Source§impl TcpStream
impl TcpStream
pub fn connect<A: ToSocketAddrs>(addr: A) -> 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<'_, u8>) -> 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_keepalive(&self, keepalive: bool) -> Result<()>
pub fn keepalive(&self) -> Result<bool>
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 set_hop_limit_v6(&self, limit: u8) -> Result<()>
pub fn hop_limit_v6(&self) -> Result<u8>
pub fn take_error(&self) -> Result<Option<Error>>
pub fn set_nonblocking(&self, nonblocking: bool) -> Result<()>
Trait Implementations§
Auto Trait Implementations§
impl Forget for TcpStream
impl Freeze for TcpStreamwhere
I32NotAllOnes: Freeze,
impl Move for TcpStream
impl RefUnwindSafe for TcpStreamwhere
I32NotAllOnes: RefUnwindSafe,
impl Send for TcpStreamwhere
I32NotAllOnes: Send,
impl Sync for TcpStreamwhere
I32NotAllOnes: Sync,
impl Unpin for TcpStreamwhere
I32NotAllOnes: Unpin,
impl UnsafeUnpin for TcpStreamwhere
I32NotAllOnes: UnsafeUnpin,
impl UnwindSafe for TcpStreamwhere
I32NotAllOnes: 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
Source§impl<T> SizeHint for Twhere
T: ?Sized,
impl<T> SizeHint for Twhere
T: ?Sized,
Source§default fn lower_bound(&self) -> usize
default fn lower_bound(&self) -> usize
🔬This is a nightly-only experimental API. (
core_io_internals)Returns a lower bound on the number of elements this container-like item
contains.
For example, an array
[u8; 12] could return any value between 0 and
12 inclusively as a correct implementation. Read moreSource§impl<T> SizedTypeProperties for T
impl<T> SizedTypeProperties for T
Source§#[doc(hidden)]const SIZE: usize
#[doc(hidden)]const SIZE: usize
🔬This is a nightly-only experimental API. (
sized_type_properties)Source§#[doc(hidden)]const ALIGN: usize
#[doc(hidden)]const ALIGN: usize
🔬This is a nightly-only experimental API. (
sized_type_properties)Source§#[doc(hidden)]const ALIGNMENT: Alignment
#[doc(hidden)]const ALIGNMENT: Alignment
🔬This is a nightly-only experimental API. (
sized_type_properties)Source§#[doc(hidden)]const IS_ZST: bool
#[doc(hidden)]const IS_ZST: bool
🔬This is a nightly-only experimental API. (
sized_type_properties)Source§#[doc(hidden)]const LAYOUT: Layout
#[doc(hidden)]const LAYOUT: Layout
🔬This is a nightly-only experimental API. (
sized_type_properties)Source§#[doc(hidden)]const MAX_SLICE_LEN: usize
#[doc(hidden)]const MAX_SLICE_LEN: usize
🔬This is a nightly-only experimental API. (
sized_type_properties)The largest safe length for a
[Self]. Read more