pub trait RangeSource {
type Document: Copy + Eq;
type Generation: Copy + Eq;
type Error;
// Required methods
fn stamp(&self) -> Stamp<Self::Document, Self::Generation>;
fn read_at<'q, W>(
&'q self,
offset: u64,
output: &'q mut [u8],
work: &'q W,
) -> impl Future<Output = Result<usize, ReadError<Self::Error>>> + 'q
where W: Work + 'q;
}Expand description
A stable range source that may suspend during bounded acquisition.
The window admits requested copy bytes before dispatch. Implementations
fund additional processing/storage through work, write only output,
and return its written length. Short reads and zero at EOF are allowed.
Whole-source materialization is not an implementation detail of this API.
Required Associated Types§
Sourcetype Generation: Copy + Eq
type Generation: Copy + Eq
Constant-time comparable immutable generation.
Required Methods§
Sourcefn stamp(&self) -> Stamp<Self::Document, Self::Generation>
fn stamp(&self) -> Stamp<Self::Document, Self::Generation>
Constant-time metadata, without allocation, traversal or I/O.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".