Struct io_extras::borrowed::BorrowedWriteable
source · #[repr(transparent)]pub struct BorrowedWriteable<'a> { /* private fields */ }
Expand description
An owning I/O handle that implements Write
.
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
].
Implementations§
source§impl<'a> BorrowedWriteable<'a>
impl<'a> BorrowedWriteable<'a>
sourcepub fn borrow(grip: BorrowedGrip<'a>) -> Self
pub fn borrow(grip: BorrowedGrip<'a>) -> Self
Create a BorrowedReadable
that can write to a BorrowedGrip
.
Trait Implementations§
source§impl<'a> AsHandleOrSocket for BorrowedWriteable<'a>
impl<'a> AsHandleOrSocket for BorrowedWriteable<'a>
BorrowedWriteable
borrows its handle.
source§fn as_handle_or_socket(&self) -> BorrowedHandleOrSocket<'a>
fn as_handle_or_socket(&self) -> BorrowedHandleOrSocket<'a>
Like
AsHandle::as_handle
and AsSocket::as_socket
but can return either type.source§impl<'a> Debug for BorrowedWriteable<'a>
impl<'a> Debug for BorrowedWriteable<'a>
source§impl<'a> Write for BorrowedWriteable<'a>
impl<'a> Write for BorrowedWriteable<'a>
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
Auto Trait Implementations§
impl<'a> RefUnwindSafe for BorrowedWriteable<'a>
impl<'a> Send for BorrowedWriteable<'a>
impl<'a> Sync for BorrowedWriteable<'a>
impl<'a> Unpin for BorrowedWriteable<'a>
impl<'a> UnwindSafe for BorrowedWriteable<'a>
Blanket Implementations§
source§impl<T> AsGrip for Twhere
T: AsHandleOrSocket,
impl<T> AsGrip for Twhere T: AsHandleOrSocket,
source§fn as_grip(&self) -> BorrowedHandleOrSocket<'_>
fn as_grip(&self) -> BorrowedHandleOrSocket<'_>
Extracts the grip.