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§
Sourcefn read_range_into(&self, range: Q42ByteRange, out: &mut [u8]) -> Result<()>
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§
impl Q42RangeSource for HttpRangeSource
Available on non-WebAssembly only.
impl Q42RangeSource for LocalFileRangeSource
Available on non-WebAssembly only.