pub trait RangeReadDataCache: AsyncDataCache {
// Required method
fn get_object_range<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
hash: &'life1 str,
algorithm: &'life2 str,
start: u64,
end: u64,
) -> Pin<Box<dyn Future<Output = Result<Vec<u8>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
// Provided method
fn stream_range_to_file_at_offset<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
hash: &'life1 str,
algorithm: &'life2 str,
range_start: u64,
range_end: u64,
dest: &'life3 Path,
file_offset: u64,
) -> Pin<Box<dyn Future<Output = Result<u64>> + Send + 'async_trait>>
where Self: Sync + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait { ... }
}Expand description
Extension trait for caches that support byte-range reads.
Required Methods§
fn get_object_range<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
hash: &'life1 str,
algorithm: &'life2 str,
start: u64,
end: u64,
) -> Pin<Box<dyn Future<Output = Result<Vec<u8>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Provided Methods§
Sourcefn stream_range_to_file_at_offset<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
hash: &'life1 str,
algorithm: &'life2 str,
range_start: u64,
range_end: u64,
dest: &'life3 Path,
file_offset: u64,
) -> Pin<Box<dyn Future<Output = Result<u64>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn stream_range_to_file_at_offset<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
hash: &'life1 str,
algorithm: &'life2 str,
range_start: u64,
range_end: u64,
dest: &'life3 Path,
file_offset: u64,
) -> Pin<Box<dyn Future<Output = Result<u64>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Stream a byte-range of a cached object directly to a file at a given offset. Default uses get_object_range + write. S3 overrides to stream without buffering.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".