Trait subspace_farmer_components::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,