Skip to main content

SyncReadAt

Trait SyncReadAt 

Source
pub trait SyncReadAt {
    // Required methods
    fn read_at(&self, offset: u64, buf: &mut [u8]) -> Result<usize>;
    fn len(&self) -> u64;

    // Provided method
    fn is_empty(&self) -> bool { ... }
}
Expand description

Sync data source supporting offset-based reads.

Enables parallel splitting by allowing concurrent reads at different offsets.

Required Methods§

Source

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

Read data at offset into buffer, returning bytes read.

Source

fn len(&self) -> u64

Total size of the data source.

Provided Methods§

Source

fn is_empty(&self) -> bool

Whether the data source is empty.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl SyncReadAt for Bytes

Source§

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

Source§

fn len(&self) -> u64

Source§

impl SyncReadAt for File

Available on Unix only.
Source§

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

Source§

fn len(&self) -> u64

Source§

impl SyncReadAt for Vec<u8>

Source§

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

Source§

fn len(&self) -> u64

Source§

impl SyncReadAt for [u8]

Source§

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

Source§

fn len(&self) -> u64

Source§

impl<T: SyncReadAt + ?Sized> SyncReadAt for &T

Source§

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

Source§

fn len(&self) -> u64

Implementors§