Skip to main content

ScanSource

Trait ScanSource 

Source
pub trait ScanSource {
    // Required methods
    fn read_at(&self, offset: u64, out: &mut [u8]) -> Result<usize, QdnfError>;
    fn logical_len(&self) -> u64;
}
Expand description

Exact-range reader. Implementations must not allocate.

Required Methods§

Source

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

Copy up to out.len() bytes from offset. Return bytes copied.

Offset at or beyond Self::logical_len yields Ok(0).

Source

fn logical_len(&self) -> u64

Logical length in bytes. Not an allocated buffer size.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§