Skip to main content

SpillFile

Trait SpillFile 

Source
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§

Source

fn size(&self) -> Option<u64>

Returns current size in bytes if cheaply available.

Source

fn read_stream( &self, ) -> Result<Pin<Box<dyn Stream<Item = Result<Bytes>> + Send>>>

Returns file contents as an async stream of byte chunks.

Source

fn open_writer(&self) -> Result<Box<dyn SpillWriter>>

Opens a writer for appending data to this file.

Provided Methods§

Source

fn path(&self) -> Option<&Path>

Returns the OS path if this is a local file, None otherwise.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§