Struct io_extras::raw::RawWriteable
source · #[repr(transparent)]pub struct RawWriteable(_);
Expand description
A non-owning unsafe I/O handle that implements Write
. Write
functions
considered are safe, so this type requires unsafe
to construct.
This doesn’t implement Into*
or From*
traits.
Platform-specific behavior
On Posix-ish platforms, this writes to the handle as if it were a
File
. On Windows, this writes to a file-like handle as if it were a
File
, and to a socket-like handle as if it were a TcpStream
.
Trait Implementations§
source§impl AsRawFd for RawWriteable
impl AsRawFd for RawWriteable
RawWriteable
doesn’t own its handle.
source§impl Clone for RawWriteable
impl Clone for RawWriteable
source§impl Debug for RawWriteable
impl Debug for RawWriteable
source§impl FromRawFd for RawWriteable
impl FromRawFd for RawWriteable
RawWriteable
doesn’t own its handle.
source§unsafe fn from_raw_fd(raw_fd: RawFd) -> Self
unsafe fn from_raw_fd(raw_fd: RawFd) -> Self
Constructs a new instance of
Self
from the given raw file
descriptor. Read moresource§impl IntoRawFd for RawWriteable
impl IntoRawFd for RawWriteable
RawWriteable
doesn’t own its handle.
source§fn into_raw_fd(self) -> RawFd
fn into_raw_fd(self) -> RawFd
Consumes this object, returning the raw underlying file descriptor. Read more
source§impl Write for RawWriteable
impl Write for RawWriteable
source§fn write(&mut self, buf: &[u8]) -> Result<usize>
fn write(&mut self, buf: &[u8]) -> Result<usize>
Write a buffer into this writer, returning how many bytes were written. Read more
source§fn flush(&mut self) -> Result<()>
fn flush(&mut self) -> Result<()>
Flush this output stream, ensuring that all intermediately buffered
contents reach their destination. Read more
source§fn is_write_vectored(&self) -> bool
fn is_write_vectored(&self) -> bool
🔬This is a nightly-only experimental API. (
can_vector
)source§fn write_all(&mut self, buf: &[u8]) -> Result<()>
fn write_all(&mut self, buf: &[u8]) -> Result<()>
Attempts to write an entire buffer into this writer. Read more
source§fn write_all_vectored(&mut self, bufs: &mut [IoSlice<'_>]) -> Result<()>
fn write_all_vectored(&mut self, bufs: &mut [IoSlice<'_>]) -> Result<()>
🔬This is a nightly-only experimental API. (
write_all_vectored
)Attempts to write multiple buffers into this writer. Read more
impl Copy for RawWriteable
Auto Trait Implementations§
impl RefUnwindSafe for RawWriteable
impl Send for RawWriteable
impl Sync for RawWriteable
impl Unpin for RawWriteable
impl UnwindSafe for RawWriteable
Blanket Implementations§
source§impl<T> AsRawFilelike for Twhere
T: AsRawFd,
impl<T> AsRawFilelike for Twhere T: AsRawFd,
source§fn as_raw_filelike(&self) -> i32
fn as_raw_filelike(&self) -> i32
Returns the raw value.
source§impl<T> AsRawGrip for Twhere
T: AsRawFd,
impl<T> AsRawGrip for Twhere T: AsRawFd,
source§fn as_raw_grip(&self) -> i32
fn as_raw_grip(&self) -> i32
Extracts the raw grip.
source§impl<T> AsRawSocketlike for Twhere
T: AsRawFd,
impl<T> AsRawSocketlike for Twhere T: AsRawFd,
source§fn as_raw_socketlike(&self) -> i32
fn as_raw_socketlike(&self) -> i32
Returns the raw value.
source§impl<T> FromRawFilelike for Twhere
T: FromRawFd,
impl<T> FromRawFilelike for Twhere T: FromRawFd,
source§unsafe fn from_raw_filelike(raw: i32) -> T
unsafe fn from_raw_filelike(raw: i32) -> T
Constructs
Self
from the raw value. Read moresource§impl<T> FromRawGrip for Twhere
T: FromRawFd,
impl<T> FromRawGrip for Twhere T: FromRawFd,
source§unsafe fn from_raw_grip(raw_grip: i32) -> T
unsafe fn from_raw_grip(raw_grip: i32) -> T
source§impl<T> FromRawSocketlike for Twhere
T: FromRawFd,
impl<T> FromRawSocketlike for Twhere T: FromRawFd,
source§unsafe fn from_raw_socketlike(raw: i32) -> T
unsafe fn from_raw_socketlike(raw: i32) -> T
Constructs
Self
from the raw value. Read moresource§impl<T> IntoRawFilelike for Twhere
T: IntoRawFd,
impl<T> IntoRawFilelike for Twhere T: IntoRawFd,
source§fn into_raw_filelike(self) -> i32
fn into_raw_filelike(self) -> i32
Returns the raw value.
source§impl<T> IntoRawGrip for Twhere
T: IntoRawFd,
impl<T> IntoRawGrip for Twhere T: IntoRawFd,
source§fn into_raw_grip(self) -> i32
fn into_raw_grip(self) -> i32
Consume
self
and convert into an RawGrip
.source§impl<T> IntoRawSocketlike for Twhere
T: IntoRawFd,
impl<T> IntoRawSocketlike for Twhere T: IntoRawFd,
source§fn into_raw_socketlike(self) -> i32
fn into_raw_socketlike(self) -> i32
Returns the raw value.