Struct utf8_io::Utf8Writer
source · [−]pub struct Utf8Writer<Inner: Write> { /* private fields */ }
Expand description
A Write
implementation which translates into an output Write
producing a valid UTF-8 sequence from an arbitrary byte sequence from an
arbitrary byte sequence. Attempts to write invalid encodings are reported
as errors.
This type’s write
is not guaranteed to perform a single underlying
write
operation, because short writes could produce invalid UTF-8, so
write
will retry as needed.
Implementations
sourceimpl<Inner: Write> Utf8Writer<Inner>
impl<Inner: Write> Utf8Writer<Inner>
sourcepub fn into_inner(self) -> Result<Inner>
pub fn into_inner(self) -> Result<Inner>
Flush any pending output and return the inner stream.
Trait Implementations
sourceimpl<Inner: Write + AsHandleOrSocket> AsHandleOrSocket for Utf8Writer<Inner>
impl<Inner: Write + AsHandleOrSocket> AsHandleOrSocket for Utf8Writer<Inner>
sourcefn as_handle_or_socket(&self) -> BorrowedHandleOrSocket<'_>
fn as_handle_or_socket(&self) -> BorrowedHandleOrSocket<'_>
Like AsHandle::as_handle
and AsSocket::as_socket
but can return either type. Read more
sourceimpl<Inner: Write + AsRawHandleOrSocket> AsRawHandleOrSocket for Utf8Writer<Inner>
impl<Inner: Write + AsRawHandleOrSocket> AsRawHandleOrSocket for Utf8Writer<Inner>
sourcefn 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. Read more
sourceimpl<Inner: Write + Debug> Debug for Utf8Writer<Inner>
impl<Inner: Write + Debug> Debug for Utf8Writer<Inner>
sourceimpl<Inner: Write> Write for Utf8Writer<Inner>
impl<Inner: Write> Write for Utf8Writer<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 is_write_vectored(&self) -> bool
fn is_write_vectored(&self) -> bool
can_vector
)Determines if this Write
r has an efficient write_vectored
implementation. Read more
1.0.0 · sourcefn write_all(&mut self, buf: &[u8]) -> Result<(), Error>
fn write_all(&mut self, buf: &[u8]) -> Result<(), Error>
Attempts to write an entire buffer into this writer. Read more
sourcefn write_all_vectored(&mut self, bufs: &mut [IoSlice<'_>]) -> Result<(), Error>
fn write_all_vectored(&mut self, bufs: &mut [IoSlice<'_>]) -> Result<(), Error>
write_all_vectored
)Attempts to write multiple buffers into this writer. Read more
Auto Trait Implementations
impl<Inner> RefUnwindSafe for Utf8Writer<Inner> where
Inner: RefUnwindSafe,
impl<Inner> Send for Utf8Writer<Inner> where
Inner: Send,
impl<Inner> Sync for Utf8Writer<Inner> where
Inner: Sync,
impl<Inner> Unpin for Utf8Writer<Inner> where
Inner: Unpin,
impl<Inner> UnwindSafe for Utf8Writer<Inner> where
Inner: UnwindSafe,
Blanket Implementations
sourceimpl<T> AsGrip for T where
T: AsHandleOrSocket,
impl<T> AsGrip for T where
T: AsHandleOrSocket,
sourcefn as_grip(&self) -> BorrowedHandleOrSocket<'_>
fn as_grip(&self) -> BorrowedHandleOrSocket<'_>
Extracts the grip.
sourceimpl<T> AsRawGrip for T where
T: AsRawHandleOrSocket,
impl<T> AsRawGrip for T where
T: AsRawHandleOrSocket,
sourcefn as_raw_grip(&self) -> RawHandleOrSocket
fn as_raw_grip(&self) -> RawHandleOrSocket
Extracts the raw grip.
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
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