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>
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
Auto Trait Implementations§
impl<'a> Freeze for BorrowedWriteable<'a>
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.
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