Trait SeekWrite

Source
pub trait SeekWrite {
    // Required method
    fn seek_write(&mut self, input: &[u8], offset: u64) -> Result<usize, Error>;

    // Provided method
    fn seek_write_all(&mut self, input: &[u8], offset: u64) -> Result<(), Error> { ... }
}
Expand description

Trait to permit an atomic Seek+Write operation

Required Methods§

Source

fn seek_write(&mut self, input: &[u8], offset: u64) -> Result<usize, Error>

Seek to the provided offset, relative to the start of the stream, and write some bytes from the provided buffer. The number of bytes written is returned.

Provided Methods§

Source

fn seek_write_all(&mut self, input: &[u8], offset: u64) -> Result<(), Error>

Writes all the data to the provided offset. May require multiple file ops & seeks if the calls do not write all the data.

Implementations on Foreign Types§

Source§

impl SeekWrite for File

Available on crate feature std only.
Source§

fn seek_write(&mut self, input: &[u8], offset: u64) -> Result<usize, Error>

Implementors§