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 AsRawHandleOrSocket for RawWriteable
impl AsRawHandleOrSocket for RawWriteable
RawWriteable
doesn’t own its handle.
Source§fn as_raw_handle_or_socket(&self) -> RawHandleOrSocket
fn as_raw_handle_or_socket(&self) -> RawHandleOrSocket
Like
AsRawHandle::as_raw_handle
and AsRawSocket::as_raw_socket
but can return either type.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 FromRawHandle for RawWriteable
impl FromRawHandle for RawWriteable
RawWriteable
doesn’t own its handle.
Source§unsafe fn from_raw_handle(raw_handle: RawHandle) -> Self
unsafe fn from_raw_handle(raw_handle: RawHandle) -> Self
Constructs a new I/O object from the specified raw handle. Read more
Source§impl FromRawHandleOrSocket for RawWriteable
impl FromRawHandleOrSocket for RawWriteable
RawWriteable
doesn’t own its handle.
Source§unsafe fn from_raw_handle_or_socket(
raw_handle_or_socket: RawHandleOrSocket,
) -> Self
unsafe fn from_raw_handle_or_socket( raw_handle_or_socket: RawHandleOrSocket, ) -> Self
Like
FromRawHandle::from_raw_handle
and
FromRawSocket::from_raw_socket
but can be passed either type. Read moreSource§impl IntoRawHandleOrSocket for RawWriteable
impl IntoRawHandleOrSocket for RawWriteable
RawWriteable
doesn’t own its handle.
Source§fn into_raw_handle_or_socket(self) -> RawHandleOrSocket
fn into_raw_handle_or_socket(self) -> RawHandleOrSocket
Like
IntoRawHandle::into_raw_handle
and
IntoRawSocket::into_raw_socket
but can return either type.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> AsRawGrip for Twhere
T: AsRawHandleOrSocket,
impl<T> AsRawGrip for Twhere
T: AsRawHandleOrSocket,
Source§fn as_raw_grip(&self) -> RawHandleOrSocket
fn as_raw_grip(&self) -> RawHandleOrSocket
Extracts the raw grip.
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: FromRawHandle,
impl<T> FromRawFilelike for Twhere
T: FromRawHandle,
Source§unsafe fn from_raw_filelike(raw: *mut c_void) -> T
unsafe fn from_raw_filelike(raw: *mut c_void) -> T
Constructs
Self
from the raw value.Source§impl<T> FromRawGrip for Twhere
T: FromRawHandleOrSocket,
impl<T> FromRawGrip for Twhere
T: FromRawHandleOrSocket,
Source§unsafe fn from_raw_grip(raw_grip: RawHandleOrSocket) -> T
unsafe fn from_raw_grip(raw_grip: RawHandleOrSocket) -> T
Source§impl<T> IntoRawGrip for Twhere
T: IntoRawHandleOrSocket,
impl<T> IntoRawGrip for Twhere
T: IntoRawHandleOrSocket,
Source§fn into_raw_grip(self) -> RawHandleOrSocket
fn into_raw_grip(self) -> RawHandleOrSocket
Consume
self
and convert into an RawGrip
.