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§
source§impl<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§
source§impl<Inner: Write + AsHandleOrSocket> AsHandleOrSocket for Utf8Writer<Inner>
impl<Inner: Write + AsHandleOrSocket> AsHandleOrSocket for Utf8Writer<Inner>
source§fn as_handle_or_socket(&self) -> BorrowedHandleOrSocket<'_>
fn as_handle_or_socket(&self) -> BorrowedHandleOrSocket<'_>
source§impl<Inner: Write + AsRawHandleOrSocket> AsRawHandleOrSocket for Utf8Writer<Inner>
impl<Inner: Write + AsRawHandleOrSocket> AsRawHandleOrSocket for Utf8Writer<Inner>
source§fn 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 moresource§impl<Inner: Write> Write for Utf8Writer<Inner>
impl<Inner: Write> Write for Utf8Writer<Inner>
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
)1.0.0 · source§fn 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
source§fn write_all_vectored(&mut self, bufs: &mut [IoSlice<'_>]) -> Result<(), Error>
fn write_all_vectored(&mut self, bufs: &mut [IoSlice<'_>]) -> Result<(), Error>
🔬This is a nightly-only experimental API. (
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§
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> AsRawGrip for Twhere
T: AsRawHandleOrSocket,
impl<T> AsRawGrip for Twhere
T: AsRawHandleOrSocket,
source§fn as_raw_grip(&self) -> RawHandleOrSocket
fn as_raw_grip(&self) -> RawHandleOrSocket
Extracts the raw grip.