[go: up one dir, main page]

OsWrite

Trait OsWrite 

Source
pub trait OsWrite: Write {
    // Provided method
    fn write_all_os(&mut self, buf: &OsStr) -> Result<()> { ... }
}
Expand description

io::Write, but for OS strings.

On Unix this works straightforwardly.

On Windows this currently returns an error if the OS string is not valid Unicode. This may in the future change to allow those strings to be written to consoles.

Provided Methods§

Source

fn write_all_os(&mut self, buf: &OsStr) -> Result<()>

Write the entire OS string into this writer.

§Errors

An error is returned if the underlying I/O operation fails.

On Windows, if the OS string is not valid Unicode, an error of kind io::ErrorKind::InvalidData is returned.

Trait Implementations§

Source§

impl OsWrite for Box<dyn OsWrite>

Source§

fn write_all_os(&mut self, buf: &OsStr) -> Result<()>

Write the entire OS string into this writer. Read more

Implementations on Foreign Types§

Source§

impl OsWrite for Box<dyn OsWrite>

Source§

fn write_all_os(&mut self, buf: &OsStr) -> Result<()>

Source§

impl OsWrite for File

Source§

impl OsWrite for Stdout

Source§

impl OsWrite for StdoutLock<'_>

Source§

impl<W: OsWrite> OsWrite for BufWriter<W>

Implementors§