pub trait RangeReader<K>: Send + Sync {
type Error: Error + Send + Sync + 'static;
// Required method
fn read_range<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 K,
range: Range<usize>,
) -> Pin<Box<dyn Future<Output = Result<Bytes, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
}Expand description
An immutable source capable of reading byte ranges.
Implementations must return exactly range.len() bytes on success. A
CachedReader checks this contract before admitting a response.
Required Associated Types§
Required Methods§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".