pub trait DataSource: Send + Sync {
// Required methods
fn size(&self) -> Result<u64>;
fn read_range(&self, range: ByteRange) -> Result<Vec<u8>>;
// Provided methods
fn read_ranges(&self, ranges: &[ByteRange]) -> Result<Vec<Vec<u8>>> { ... }
fn supports_range_requests(&self) -> bool { ... }
}Expand description
Trait for synchronous data sources
Required Methods§
Provided Methods§
Sourcefn read_ranges(&self, ranges: &[ByteRange]) -> Result<Vec<Vec<u8>>>
fn read_ranges(&self, ranges: &[ByteRange]) -> Result<Vec<Vec<u8>>>
Reads bytes from multiple ranges (for optimization)
Sourcefn supports_range_requests(&self) -> bool
fn supports_range_requests(&self) -> bool
Returns true if this data source supports range requests