pub trait SpillFile: Send + Sync {
// Required methods
fn size(&self) -> Option<u64>;
fn read_stream(
&self,
) -> Result<Pin<Box<dyn Stream<Item = Result<Bytes>> + Send>>>;
fn open_writer(&self) -> Result<Box<dyn SpillWriter>>;
// Provided method
fn path(&self) -> Option<&Path> { ... }
}Expand description
Abstraction over a spill file backend. Implementations handle their own quota enforcement and blocking concerns.
Required Methods§
Sourcefn read_stream(
&self,
) -> Result<Pin<Box<dyn Stream<Item = Result<Bytes>> + Send>>>
fn read_stream( &self, ) -> Result<Pin<Box<dyn Stream<Item = Result<Bytes>> + Send>>>
Returns file contents as an async stream of byte chunks.
Sourcefn open_writer(&self) -> Result<Box<dyn SpillWriter>>
fn open_writer(&self) -> Result<Box<dyn SpillWriter>>
Opens a writer for appending data to this file.
Provided Methods§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".