Skip to main content

SegmentSource

Trait SegmentSource 

Source
pub trait SegmentSource:
    'static
    + Send
    + Sync {
    // Required method
    fn request(
        &self,
        id: SegmentId,
    ) -> Pin<Box<dyn Future<Output = Result<BufferHandle, VortexError>> + Send>>;
}
Expand description

Reads segments by id.

Implementations may issue asynchronous file reads, object-store requests, cache lookups, or in-memory buffer slices. Returned futures must be independent and safe to poll concurrently.

Required Methods§

Source

fn request( &self, id: SegmentId, ) -> Pin<Box<dyn Future<Output = Result<BufferHandle, VortexError>> + Send>>

Request a segment, returning a future that will eventually resolve to the segment data.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementations on Foreign Types§

Source§

impl SegmentSource for Arc<dyn SegmentSource>

Source§

fn request( &self, id: SegmentId, ) -> Pin<Box<dyn Future<Output = Result<BufferHandle, VortexError>> + Send>>

Implementors§