Trait axstd::io::prelude::Write

source ·
pub trait Write {
    // Required methods
    fn write(&mut self, buf: &[u8]) -> Result<usize, AxError>;
    fn flush(&mut self) -> Result<(), AxError>;

    // Provided methods
    fn write_all(&mut self, buf: &[u8]) -> Result<(), AxError> { ... }
    fn write_fmt(&mut self, fmt: Arguments<'_>) -> Result<(), AxError> { ... }
}
Expand description

A trait for objects which are byte-oriented sinks.

Required Methods§

source

fn write(&mut self, buf: &[u8]) -> Result<usize, AxError>

Write a buffer into this writer, returning how many bytes were written.

source

fn flush(&mut self) -> Result<(), AxError>

Flush this output stream, ensuring that all intermediately buffered contents reach their destination.

Provided Methods§

source

fn write_all(&mut self, buf: &[u8]) -> Result<(), AxError>

Attempts to write an entire buffer into this writer.

source

fn write_fmt(&mut self, fmt: Arguments<'_>) -> Result<(), AxError>

Writes a formatted string into this writer, returning any error encountered.

Implementations on Foreign Types§

source§

impl Write for File

source§

fn write(&mut self, buf: &[u8]) -> Result<usize, AxError>

source§

fn flush(&mut self) -> Result<(), AxError>

source§

impl Write for TcpSocket

source§

fn write(&mut self, buf: &[u8]) -> Result<usize, AxError>

source§

fn flush(&mut self) -> Result<(), AxError>

source§

impl Write for UdpSocket

source§

fn write(&mut self, buf: &[u8]) -> Result<usize, AxError>

source§

fn flush(&mut self) -> Result<(), AxError>

Implementors§

source§

impl Write for axstd::fs::File

Available on crate feature fs only.
source§

impl Write for TcpStream

Available on crate feature net only.
source§

impl Write for Stdout

source§

impl Write for StdoutLock<'_>