pub struct RawWriteable(/* private fields */);
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
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§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>
Writes a buffer into this writer, returning how many bytes were written. Read more
Source§fn flush(&mut self) -> Result<()>
fn flush(&mut self) -> Result<()>
Flushes 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 Freeze for RawWriteable
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> 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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)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.