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> AsFd for BorrowedWriteable<'a>
impl<'a> AsFd for BorrowedWriteable<'a>
BorrowedWriteable
borrows its handle.
Source§fn as_fd(&self) -> BorrowedFd<'a>
fn as_fd(&self) -> BorrowedFd<'a>
Borrows the file descriptor. Read more
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> AsFilelike for Twhere
T: AsFd,
impl<T> AsFilelike for Twhere
T: AsFd,
Source§fn as_filelike(&self) -> BorrowedFd<'_>
fn as_filelike(&self) -> BorrowedFd<'_>
Borrows the reference. Read more
Source§fn as_filelike_view<Target>(&self) -> FilelikeView<'_, Target>where
Target: FilelikeViewType,
fn as_filelike_view<Target>(&self) -> FilelikeView<'_, Target>where
Target: FilelikeViewType,
Return a borrowing view of a resource which dereferences to a
&Target
. Read moreSource§impl<T> AsGrip for Twhere
T: AsFd,
impl<T> AsGrip for Twhere
T: AsFd,
Source§fn as_grip(&self) -> BorrowedFd<'_>
fn as_grip(&self) -> BorrowedFd<'_>
Extracts the grip.
Source§impl<T> AsSocketlike for Twhere
T: AsFd,
impl<T> AsSocketlike for Twhere
T: AsFd,
Source§fn as_socketlike(&self) -> BorrowedFd<'_>
fn as_socketlike(&self) -> BorrowedFd<'_>
Borrows the reference.
Source§fn as_socketlike_view<Target>(&self) -> SocketlikeView<'_, Target>where
Target: SocketlikeViewType,
fn as_socketlike_view<Target>(&self) -> SocketlikeView<'_, Target>where
Target: SocketlikeViewType,
Return a borrowing view of a resource which dereferences to a
&Target
. Read moreSource§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