Skip to main content

RasterStreaming

Trait RasterStreaming 

Source
pub trait RasterStreaming: Send + Sync {
    // Required methods
    fn next_chunk<'life0, 'async_trait>(
        &'life0 mut self,
    ) -> Pin<Box<dyn Future<Output = Result<Option<RasterChunk>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn next_chunks<'life0, 'async_trait>(
        &'life0 mut self,
        count: usize,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<RasterChunk>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn seek_to_chunk<'life0, 'async_trait>(
        &'life0 mut self,
        row: usize,
        col: usize,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn total_chunks(&self) -> (usize, usize);
    fn current_position(&self) -> (usize, usize);
    fn has_more_chunks(&self) -> bool;
}
Expand description

Async trait for raster streaming.

Required Methods§

Source

fn next_chunk<'life0, 'async_trait>( &'life0 mut self, ) -> Pin<Box<dyn Future<Output = Result<Option<RasterChunk>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get the next chunk from the stream.

Source

fn next_chunks<'life0, 'async_trait>( &'life0 mut self, count: usize, ) -> Pin<Box<dyn Future<Output = Result<Vec<RasterChunk>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get multiple chunks in parallel.

Source

fn seek_to_chunk<'life0, 'async_trait>( &'life0 mut self, row: usize, col: usize, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Skip to a specific chunk by index.

Source

fn total_chunks(&self) -> (usize, usize)

Get the total number of chunks.

Source

fn current_position(&self) -> (usize, usize)

Get the current position in the stream.

Source

fn has_more_chunks(&self) -> bool

Check if the stream has more chunks.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§