RangeReader

Trait RangeReader 

Source
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 GetObject with Range header)
  • HTTP URLs (using Range header)

Required Methods§

Source

fn read_range(&self, offset: u64, length: usize) -> AnyResult<Vec<u8>>

Read a range of bytes from the source

Source

fn size(&self) -> u64

Get the total size of the source in bytes

Source

fn identifier(&self) -> &str

Get a human-readable identifier for this source (for logging/errors)

Provided Methods§

Source

fn is_local(&self) -> bool

Check if this is a local file (fast random access) or remote (expensive reads)

Implementors§