pub async fn write_at(&self, buf: Vec<u8>, pos: u64) -> Result<usize> {
        let source =
            self.file
                .reactor
                .upgrade()
                .unwrap()
                .write_buffered(self.as_raw_fd(), buf, pos);
        source.collect_rw().await.map_err(|source| {
            GlommioError::create_enhanced(
                source,
                "Writing",
                self.file.path.borrow().as_ref(),
                Some(self.as_raw_fd()),
            )
        })
    }
/// Write the data in the buffer `buf` to this `BufferedFile` at the
/// specified position
///
/// This method acquires ownership of the buffer so the buffer can be kept
/// alive while the kernel has it.
///
/// Note that it is legal to return fewer bytes than the buffer size. That
/// is the situation, for example, when the device runs out of space
/// (See the man page for `write(2)` for details)
///
/// # Examples
/// ```no_run
/// use glommio::{io::BufferedFile, LocalExecutor};
///
/// let ex = LocalExecutor::default();
/// ex.run(async {
///     let file = BufferedFile::create("test.txt").await.unwrap();
///
///     let mut buf = vec![0, 1, 2, 3];
///     file.write_at(buf, 0).await.unwrap();
///     file.close().await.unwrap();
/// });
/// ```
Write the data in the buffer `buf` to this `BufferedFile` at the
specified position

This method acquires ownership of the buffer so the buffer can be kept
alive while the kernel has it.

Note that it is legal to return fewer bytes than the buffer size. That
is the situation, for example, when the device runs out of space
(See the man page for `write(2)` for details)
Write the data in the buffer ` buf ` to this ` BufferedFile ` at the specified position This method acquires ownership of the buffer so the buffer can be kept alive while the kernel has it . Note that it is legal to return fewer bytes than the buffer size . That is the situation for example when the device runs out of space ( See the man page for ` write ( 2 ) ` for details )
pub async fn write_at(&self, buf: Vec<u8>, pos: u64) -> Result<usize> {
        let source =
            self.file
                .reactor
                .upgrade()
                .unwrap()
                .write_buffered(self.as_raw_fd(), buf, pos);
        source.collect_rw().await.map_err(|source| {
            GlommioError::create_enhanced(
                source,
                "Writing",
                self.file.path.borrow().as_ref(),
                Some(self.as_raw_fd()),
            )
        })
    }
pub async fn write_at ( & self , buf : Vec < u8 > , pos : u64 ) -> Result < usize > { let source = self . file . reactor . upgrade ( ) . unwrap ( ) . write_buffered ( self . as_raw_fd ( ) , buf , pos ) ; source . collect_rw ( ) . await . map_err ( | source | { GlommioError :: create_enhanced ( source , " " , self . file . path . borrow ( ) . as_ref ( ) , Some ( self . as_raw_fd ( ) ) , ) } ) }
Write the data in the buffer `buf` to this `BufferedFile` at the
specified position
Write the data in the buffer ` buf ` to this ` BufferedFile ` at the specified position
&self
buf
Vec<u8>
pos
u64
&self
buf
Vec<u8>
pos
u64
examples
```no_run
use glommio::{io::BufferedFile, LocalExecutor}.

let ex = LocalExecutor::default();
ex.run(async {
let file = BufferedFile::create("test.txt").await.unwrap().


` ` ` no_run use glommio :: { io :: BufferedFile LocalExecutor } . let ex = LocalExecutor :: default () ; ex . run ( async { let file = BufferedFile :: create ( " test . txt " ) . await . unwrap () .