pub trait SegmentCache: Send + Sync {
// Required methods
fn get<'life0, 'async_trait>(
&'life0 self,
id: SegmentId,
) -> Pin<Box<dyn Future<Output = VortexResult<Option<ByteBuffer>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn put<'life0, 'async_trait>(
&'life0 self,
id: SegmentId,
buffer: ByteBuffer,
) -> Pin<Box<dyn Future<Output = VortexResult<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
}Expand description
Cache for individual segment byte buffers.
Caches are optional and operate above a SegmentSource. They should only store host buffers:
device buffers and other non-host handles should be passed through uncached.
Required Methods§
Sourcefn get<'life0, 'async_trait>(
&'life0 self,
id: SegmentId,
) -> Pin<Box<dyn Future<Output = VortexResult<Option<ByteBuffer>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get<'life0, 'async_trait>(
&'life0 self,
id: SegmentId,
) -> Pin<Box<dyn Future<Output = VortexResult<Option<ByteBuffer>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Return a cached segment, or None on cache miss.
Sourcefn put<'life0, 'async_trait>(
&'life0 self,
id: SegmentId,
buffer: ByteBuffer,
) -> Pin<Box<dyn Future<Output = VortexResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn put<'life0, 'async_trait>(
&'life0 self,
id: SegmentId,
buffer: ByteBuffer,
) -> Pin<Box<dyn Future<Output = VortexResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Store a segment in the cache.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".