pub trait ByteSource: Send + Sync {
// Required methods
async fn get_size(&self) -> Result<usize, PolarsError>;
async fn get_range(
&self,
range: Range<usize>,
) -> Result<MemSlice, PolarsError>;
async fn get_ranges(
&self,
ranges: &mut [Range<usize>],
) -> Result<HashMap<usize, MemSlice, RandomState>, PolarsError>;
}
Available on crate features
polars-io
and cloud
only.Required Methods§
async fn get_size(&self) -> Result<usize, PolarsError>
Sourceasync fn get_range(&self, range: Range<usize>) -> Result<MemSlice, PolarsError>
async fn get_range(&self, range: Range<usize>) -> Result<MemSlice, PolarsError>
§Panics
Panics if range
is not in bounds.
Sourceasync fn get_ranges(
&self,
ranges: &mut [Range<usize>],
) -> Result<HashMap<usize, MemSlice, RandomState>, PolarsError>
async fn get_ranges( &self, ranges: &mut [Range<usize>], ) -> Result<HashMap<usize, MemSlice, RandomState>, PolarsError>
Note: This will mutably sort ranges for coalescing.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.