[−][src]Struct cap_std::net::TcpStream
A TCP stream between a local and a remote socket.
This corresponds to std::net::TcpStream
.
Note that this TcpStream
has no connect
method. To create a TcpStream
,
you must first obtain a Catalog
permitting the address, and then call
Catalog::connect_tcp_stream
.
Implementations
impl TcpStream
[src]
pub unsafe fn from_std(std: TcpStream) -> Self
[src]
Constructs a new instance of Self
from the given std::net::TcpStream
.
Safety
std::net::TcpStream
is not sandboxed and may access any address that the host
process has access to.
pub fn local_addr(&self) -> Result<SocketAddr>
[src]
Returns the local socket address of this listener.
This corresponds to std::net::TcpStream::local_addr
.
pub fn shutdown(&self, how: Shutdown) -> Result<()>
[src]
Shuts down the read, write, or both halves of this connection.
This corresponds to std::net::TcpStream::shutdown
.
pub fn try_clone(&self) -> Result<Self>
[src]
Creates a new independently owned handle to the underlying socket.
This corresponds to std::net::TcpStream::try_clone
.
pub fn set_read_timeout(&self, dur: Option<Duration>) -> Result<()>
[src]
Sets the read timeout to the timeout specified.
This corresponds to std::net::TcpStream::set_read_timeout
.
pub fn set_write_timeout(&self, dur: Option<Duration>) -> Result<()>
[src]
Sets the write timeout to the timeout specified.
This corresponds to std::net::TcpStream::set_write_timeout
.
pub fn read_timeout(&self) -> Result<Option<Duration>>
[src]
Returns the read timeout of this socket.
This corresponds to std::net::TcpStream::read_timeout
.
pub fn write_timeout(&self) -> Result<Option<Duration>>
[src]
Returns the write timeout of this socket.
This corresponds to std::net::TcpStream::write_timeout
.
pub fn peek(&self, buf: &mut [u8]) -> Result<usize>
[src]
Receives data on the socket from the remote address to which it is connected, without removing that data from the queue.
This corresponds to std::net::TcpStream::peek
.
pub fn set_nodelay(&self, nodelay: bool) -> Result<()>
[src]
Sets the value of the TCP_NODELAY
option on this socket.
This corresponds to std::net::TcpStream::set_nodelay
.
pub fn nodelay(&self) -> Result<bool>
[src]
Gets the value of the TCP_NODELAY
option on this socket.
This corresponds to std::net::TcpStream::nodelay
.
pub fn set_ttl(&self, ttl: u32) -> Result<()>
[src]
Sets the value for the IP_TTL
option on this socket.
This corresponds to std::net::TcpStream::set_ttl
.
pub fn ttl(&self) -> Result<u32>
[src]
Gets the value of the IP_TTL
option for this socket.
This corresponds to std::net::TcpStream::ttl
.
pub fn take_error(&self) -> Result<Option<Error>>
[src]
Gets the value of the SO_ERROR
option on this socket.
This corresponds to std::net::TcpStream::take_error
.
pub fn set_nonblocking(&self, nonblocking: bool) -> Result<()>
[src]
Moves this TCP stream into or out of nonblocking mode.
This corresponds to std::net::TcpStream::set_nonblocking
.
Trait Implementations
impl AsRawFd for TcpStream
[src]
impl FromRawFd for TcpStream
[src]
pub unsafe fn from_raw_fd(fd: RawFd) -> Self
[src]
impl IntoRawFd for TcpStream
[src]
pub fn into_raw_fd(self) -> RawFd
[src]
impl Read for TcpStream
[src]
pub fn read(&mut self, buf: &mut [u8]) -> Result<usize>
[src]
pub fn read_vectored(&mut self, bufs: &mut [IoSliceMut<'_>]) -> Result<usize>
[src]
pub fn read_exact(&mut self, buf: &mut [u8]) -> Result<()>
[src]
pub fn read_to_end(&mut self, buf: &mut Vec<u8>) -> Result<usize>
[src]
pub fn read_to_string(&mut self, buf: &mut String) -> Result<usize>
[src]
pub fn is_read_vectored(&self) -> bool
[src]
pub unsafe fn initializer(&self) -> Initializer
[src]
pub fn by_ref(&mut self) -> &mut Self
1.0.0[src]
pub fn bytes(self) -> Bytes<Self>
1.0.0[src]
pub fn chain<R>(self, next: R) -> Chain<Self, R> where
R: Read,
1.0.0[src]
R: Read,
pub fn take(self, limit: u64) -> Take<Self>
1.0.0[src]
impl<'_> Read for &'_ TcpStream
[src]
pub fn read(&mut self, buf: &mut [u8]) -> Result<usize>
[src]
pub fn read_vectored(&mut self, bufs: &mut [IoSliceMut<'_>]) -> Result<usize>
[src]
pub fn read_exact(&mut self, buf: &mut [u8]) -> Result<()>
[src]
pub fn read_to_end(&mut self, buf: &mut Vec<u8>) -> Result<usize>
[src]
pub fn read_to_string(&mut self, buf: &mut String) -> Result<usize>
[src]
pub fn is_read_vectored(&self) -> bool
[src]
pub unsafe fn initializer(&self) -> Initializer
[src]
pub fn by_ref(&mut self) -> &mut Self
1.0.0[src]
pub fn bytes(self) -> Bytes<Self>
1.0.0[src]
pub fn chain<R>(self, next: R) -> Chain<Self, R> where
R: Read,
1.0.0[src]
R: Read,
pub fn take(self, limit: u64) -> Take<Self>
1.0.0[src]
impl Write for TcpStream
[src]
pub fn write(&mut self, buf: &[u8]) -> Result<usize>
[src]
pub fn flush(&mut self) -> Result<()>
[src]
pub fn write_vectored(&mut self, bufs: &[IoSlice<'_>]) -> Result<usize>
[src]
pub fn write_all(&mut self, buf: &[u8]) -> Result<()>
[src]
pub fn is_write_vectored(&self) -> bool
[src]
pub fn write_all_vectored(
&mut self,
bufs: &mut [IoSlice<'_>]
) -> Result<(), Error>
[src]
&mut self,
bufs: &mut [IoSlice<'_>]
) -> Result<(), Error>
pub fn write_fmt(&mut self, fmt: Arguments<'_>) -> Result<(), Error>
1.0.0[src]
pub fn by_ref(&mut self) -> &mut Self
1.0.0[src]
impl<'_> Write for &'_ TcpStream
[src]
pub fn write(&mut self, buf: &[u8]) -> Result<usize>
[src]
pub fn flush(&mut self) -> Result<()>
[src]
pub fn write_vectored(&mut self, bufs: &[IoSlice<'_>]) -> Result<usize>
[src]
pub fn write_all(&mut self, buf: &[u8]) -> Result<()>
[src]
pub fn is_write_vectored(&self) -> bool
[src]
pub fn write_all_vectored(
&mut self,
bufs: &mut [IoSlice<'_>]
) -> Result<(), Error>
[src]
&mut self,
bufs: &mut [IoSlice<'_>]
) -> Result<(), Error>
pub fn write_fmt(&mut self, fmt: Arguments<'_>) -> Result<(), Error>
1.0.0[src]
pub fn by_ref(&mut self) -> &mut Self
1.0.0[src]
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
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> SetTimes for T where
T: AsRawFd,
T: AsRawFd,
pub fn set_times(
&self,
atime: Option<SystemTimeSpec>,
mtime: Option<SystemTimeSpec>
) -> Result<(), Error>
&self,
atime: Option<SystemTimeSpec>,
mtime: Option<SystemTimeSpec>
) -> Result<(), Error>
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,