Trait Utf16WriteExt

Source
pub trait Utf16WriteExt: WriteBytesExt {
    // Provided methods
    fn write_shorts<T: ByteOrder>(&mut self, buf: &[u16]) -> Result<usize> { ... }
    fn write_all_shorts<T: ByteOrder>(&mut self, buf: &[u16]) -> Result<()> { ... }
    fn write_bom<T: ByteOrder>(&mut self) -> Result<()> { ... }
    fn write_utf16_string<'a, T: ByteOrder>(
        &mut self,
        s: &'a str,
    ) -> Result<Utf16Written<'a>> { ... }
}
Expand description

An extension of std::io::Write for utf16

Provided Methods§

Source

fn write_shorts<T: ByteOrder>(&mut self, buf: &[u16]) -> Result<usize>

Like Write::write but with u16s

Source

fn write_all_shorts<T: ByteOrder>(&mut self, buf: &[u16]) -> Result<()>

Like Write::write_all but with u16s

Source

fn write_bom<T: ByteOrder>(&mut self) -> Result<()>

Writes a byte order maker character

Source

fn write_utf16_string<'a, T: ByteOrder>( &mut self, s: &'a str, ) -> Result<Utf16Written<'a>>

Writes a string as UTF-16

Returns Ok(len) of the string written so far

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§