You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: io.rs
    path of file: ./repos/fluke/crates/fluke-maybe-uring/src
    
    the code of the file until where you have to start completion: use crate::{
    buf::{IoBuf, IoBufMut},
    BufResult,
};

mod chan;
pub use chan::*;

mod buf_or_slice;
use 
    
    async fn write_all<B: IoBuf>(&mut self, mut buf: B) -> std::io::Result<()> {
        let mut written = 0;
        let len = buf.bytes_init();
        while written < len {
            let (res, slice) = self.write(buf.slice(written..len)).await;
            buf = slice.into_inner();
            let n = res?;
            if n == 0 {
                return Err(std::io::Error::new(
                    std::io::ErrorKind::WriteZero,
                    "write zero",
                ));
            }
            written += n;
        }
        Ok(())
    }