subspace_farmer_components

Trait ReadAtSync

Source
pub trait ReadAtSync: Send + Sync {
    // Required method
    fn read_at(&self, buf: &mut [u8], offset: u64) -> Result<()>;

    // Provided method
    fn offset(&self, offset: u64) -> ReadAtOffset<'_, Self>
       where Self: Sized { ... }
}
Expand description

Sync version of ReadAt, it is both Send and Sync and is supposed to be used with a thread pool

Required Methods§

Source

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

Fill the buffer by reading bytes at a specific offset

Provided Methods§

Source

fn offset(&self, offset: u64) -> ReadAtOffset<'_, Self>
where Self: Sized,

Get implementation of ReadAtSync that add specified offset to all attempted reads

Implementations on Foreign Types§

Source§

impl ReadAtSync for &Vec<u8>

Source§

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

Source§

impl ReadAtSync for &File

Source§

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

Source§

impl ReadAtSync for &[u8]

Source§

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

Source§

impl ReadAtSync for !

Source§

fn read_at(&self, _buf: &mut [u8], _offset: u64) -> Result<()>

Source§

impl ReadAtSync for Vec<u8>

Source§

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

Source§

impl ReadAtSync for File

Source§

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

Source§

impl ReadAtSync for [u8]

Source§

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

Implementors§

Source§

impl<T> ReadAtSync for &ReadAtOffset<'_, T>
where T: ReadAtSync,

Source§

impl<T> ReadAtSync for ReadAtOffset<'_, T>
where T: ReadAtSync,