[][src]Trait io_ranges::WriteAt

pub trait WriteAt: MinimalFile {
    fn write_at(&mut self, buf: &[u8], offset: u64) -> Result<usize>;
fn write_all_at(&mut self, buf: &[u8], offset: u64) -> Result<()>;
fn write_vectored_at(
        &mut self,
        bufs: &[IoSlice<'_>],
        offset: u64
    ) -> Result<usize>;
fn write_all_vectored_at(
        &mut self,
        bufs: &mut [IoSlice<'_>],
        offset: u64
    ) -> Result<()>;
fn is_write_vectored_at(&self) -> bool;
fn copy_from<R: ReadAt>(
        &mut self,
        offset: u64,
        input: &R,
        input_offset: u64,
        len: u64
    ) -> Result<u64>;
fn set_len(&mut self, size: u64) -> Result<()>; }

A trait for writing to files.

Required methods

fn write_at(&mut self, buf: &[u8], offset: u64) -> Result<usize>[src]

Writes a number of bytes starting from a given offset.

This is similar to std::os::unix::fs::FileExt::write_at, except it takes self by immutable reference since the entire side effect is I/O, and it's supported on non-Unix platforms including Windows.

fn write_all_at(&mut self, buf: &[u8], offset: u64) -> Result<()>[src]

Attempts to write an entire buffer starting from a given offset.

This is similar to std::os::unix::fs::FileExt::write_all_at, except it takes self by immutable reference since the entire side effect is I/O, and it's supported on non-Unix platforms including Windows.

fn write_vectored_at(
    &mut self,
    bufs: &[IoSlice<'_>],
    offset: u64
) -> Result<usize>
[src]

Is to write_vectored what write_at is to write.

fn write_all_vectored_at(
    &mut self,
    bufs: &mut [IoSlice<'_>],
    offset: u64
) -> Result<()>
[src]

Is to write_all_vectored what write_all_at is to write_all.

fn is_write_vectored_at(&self) -> bool[src]

Determines if Self has an efficient write_vectored_at implementation.

fn copy_from<R: ReadAt>(
    &mut self,
    offset: u64,
    input: &R,
    input_offset: u64,
    len: u64
) -> Result<u64>
[src]

Copy len bytes from input at input_offset to self at offset.

fn set_len(&mut self, size: u64) -> Result<()>[src]

Truncates or extends the underlying file, updating the size of this file to become size.

Loading content...

Implementations on Foreign Types

impl WriteAt for File[src]

impl WriteAt for [u8][src]

impl WriteAt for Vec<u8>[src]

Loading content...

Implementors

impl WriteAt for FileEditor[src]

impl WriteAt for FileWriter[src]

Loading content...