pub trait RangeReader: Send + Sync {
// Required methods
fn read_range(&self, offset: u64, length: usize) -> AnyResult<Vec<u8>>;
fn size(&self) -> u64;
fn identifier(&self) -> &str;
// Provided method
fn is_local(&self) -> bool { ... }
}Expand description
Trait for reading byte ranges from any source
This abstraction allows the same COG reading code to work with:
- Local files (using seek + read)
- S3 objects (using
GetObjectwith Range header) - HTTP URLs (using Range header)
Required Methods§
Sourcefn read_range(&self, offset: u64, length: usize) -> AnyResult<Vec<u8>>
fn read_range(&self, offset: u64, length: usize) -> AnyResult<Vec<u8>>
Read a range of bytes from the source
Sourcefn identifier(&self) -> &str
fn identifier(&self) -> &str
Get a human-readable identifier for this source (for logging/errors)