Skip to main content

Q42RangeSource

Trait Q42RangeSource 

Source
pub trait Q42RangeSource {
    // Required methods
    fn length(&self) -> Result<u64>;
    fn read_range_into(&self, range: Q42ByteRange, out: &mut [u8]) -> Result<()>;
}
Expand description

Exact, caller-buffered random access. Implementations must fail if the source returns a short response; partial data is never treated as success.

Required Methods§

Source

fn length(&self) -> Result<u64>

Total byte length of the source.

Source

fn read_range_into(&self, range: Q42ByteRange, out: &mut [u8]) -> Result<()>

Fill out with exactly range.length bytes at range.offset — exact-fit contract, short responses must error.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§

Source§

impl Q42RangeSource for HttpRangeSource

Available on non-WebAssembly only.
Source§

impl Q42RangeSource for LocalFileRangeSource

Available on non-WebAssembly only.
Source§

impl Q42RangeSource for Q42AuthenticatedRangeSource<'_, '_>

Source§

impl<B: AsRef<[u8]>> Q42RangeSource for OpfsSliceRangeSource<B>

Source§

impl<F> Q42RangeSource for OpfsCallbackRangeSource<F>
where F: Fn(u64, usize, &mut [u8]) -> Result<usize>,