Struct layered_io::LayeredWriter
source · pub struct LayeredWriter<Inner> { /* private fields */ }
Expand description
Adapts a std::io::Write
to implement WriteLayered
.
Implementations
sourceimpl<Inner: Write> LayeredWriter<Inner>
impl<Inner: Write> LayeredWriter<Inner>
sourcepub fn get_mut(&mut self) -> &mut Inner
pub fn get_mut(&mut self) -> &mut Inner
Gets a mutable reference to the underlying writer.
It is inadvisable to directly write to the underlying writer.
sourcepub fn close_into_inner(self) -> Result<Inner>
pub fn close_into_inner(self) -> Result<Inner>
Close this LayeredWriter
and return the inner stream.
sourcepub fn abandon_into_inner(self) -> Option<Inner>
pub fn abandon_into_inner(self) -> Option<Inner>
Consume this LayeredWriter
and return the inner stream.
Trait Implementations
sourceimpl<Inner: Write + AsFd> AsFd for LayeredWriter<Inner>
impl<Inner: Write + AsFd> AsFd for LayeredWriter<Inner>
sourcefn as_fd(&self) -> BorrowedFd<'_>
fn as_fd(&self) -> BorrowedFd<'_>
Borrows the file descriptor. Read more
sourceimpl<Inner: Write + AsRawFd> AsRawFd for LayeredWriter<Inner>
impl<Inner: Write + AsRawFd> AsRawFd for LayeredWriter<Inner>
sourceimpl<Inner> Bufferable for LayeredWriter<Inner>
impl<Inner> Bufferable for LayeredWriter<Inner>
sourcefn suggested_buffer_size(&self) -> usize
fn suggested_buffer_size(&self) -> usize
A suggested size, in bytes, for buffering for performance.
sourceimpl<Inner: Debug> Debug for LayeredWriter<Inner>
impl<Inner: Debug> Debug for LayeredWriter<Inner>
sourceimpl<Inner> Drop for LayeredWriter<Inner>
impl<Inner> Drop for LayeredWriter<Inner>
sourceimpl<Inner: Write> Write for LayeredWriter<Inner>
impl<Inner: Write> Write for LayeredWriter<Inner>
sourcefn 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
sourcefn flush(&mut self) -> Result<()>
fn flush(&mut self) -> Result<()>
Flush this output stream, ensuring that all intermediately buffered
contents reach their destination. Read more
sourcefn write_vectored(&mut self, bufs: &[IoSlice<'_>]) -> Result<usize>
fn write_vectored(&mut self, bufs: &[IoSlice<'_>]) -> Result<usize>
sourcefn is_write_vectored(&self) -> bool
fn is_write_vectored(&self) -> bool
🔬This is a nightly-only experimental API. (
can_vector
)sourcefn 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
sourcefn 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
sourceimpl<Inner: Write> WriteLayered for LayeredWriter<Inner>
impl<Inner: Write> WriteLayered for LayeredWriter<Inner>
Auto Trait Implementations
impl<Inner> RefUnwindSafe for LayeredWriter<Inner>where
Inner: RefUnwindSafe,
impl<Inner> Send for LayeredWriter<Inner>where
Inner: Send,
impl<Inner> Sync for LayeredWriter<Inner>where
Inner: Sync,
impl<Inner> Unpin for LayeredWriter<Inner>where
Inner: Unpin,
impl<Inner> UnwindSafe for LayeredWriter<Inner>where
Inner: UnwindSafe,
Blanket Implementations
sourceimpl<T> AsFilelike for Twhere
T: AsFd,
impl<T> AsFilelike for Twhere
T: AsFd,
sourcefn as_filelike(&self) -> BorrowedFd<'_>
fn as_filelike(&self) -> BorrowedFd<'_>
Borrows the reference. Read more
sourcefn 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 moresourceimpl<T> AsRawFilelike for Twhere
T: AsRawFd,
impl<T> AsRawFilelike for Twhere
T: AsRawFd,
sourcefn as_raw_filelike(&self) -> i32
fn as_raw_filelike(&self) -> i32
Returns the raw value.
sourceimpl<T> AsRawGrip for Twhere
T: AsRawFd,
impl<T> AsRawGrip for Twhere
T: AsRawFd,
sourcefn as_raw_grip(&self) -> i32
fn as_raw_grip(&self) -> i32
Extracts the raw grip.
sourceimpl<T> AsRawSocketlike for Twhere
T: AsRawFd,
impl<T> AsRawSocketlike for Twhere
T: AsRawFd,
sourcefn as_raw_socketlike(&self) -> i32
fn as_raw_socketlike(&self) -> i32
Returns the raw value.
sourceimpl<T> AsSocketlike for Twhere
T: AsFd,
impl<T> AsSocketlike for Twhere
T: AsFd,
sourcefn as_socketlike(&self) -> BorrowedFd<'_>
fn as_socketlike(&self) -> BorrowedFd<'_>
Borrows the reference.
sourcefn 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 moresourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more