vortex_layout/segments/
source.rs

1use std::sync::Arc;
2
3use futures::future::BoxFuture;
4use vortex_buffer::ByteBuffer;
5use vortex_error::VortexResult;
6
7use crate::segments::SegmentId;
8
9/// Static future resolving to a segment byte buffer.
10pub type SegmentFuture = BoxFuture<'static, VortexResult<ByteBuffer>>;
11
12/// A trait for providing segment data to a [`crate::LayoutReader`].
13pub trait SegmentSource: 'static + Send + Sync {
14    /// Request a segment, returning a future that will eventually resolve to the segment data.
15    fn request(&self, id: SegmentId, for_whom: &Arc<str>) -> SegmentFuture;
16}