pub struct SpillFile { /* private fields */ }Expand description
Handle for a single spill file.
SpillFile manages a temporary file used for spilling operator state to disk. It supports:
- Buffered writing for efficiency
- Multiple readers for concurrent access
- Automatic byte counting
Implementations§
Source§impl SpillFile
impl SpillFile
Sourcepub fn bytes_written(&self) -> u64
pub fn bytes_written(&self) -> u64
Returns the number of bytes written to this file.
Sourcepub fn write_u64_le(&mut self, value: u64) -> Result<()>
pub fn write_u64_le(&mut self, value: u64) -> Result<()>
Sourcepub fn write_i64_le(&mut self, value: i64) -> Result<()>
pub fn write_i64_le(&mut self, value: i64) -> Result<()>
Sourcepub fn write_bytes(&mut self, data: &[u8]) -> Result<()>
pub fn write_bytes(&mut self, data: &[u8]) -> Result<()>
Writes a length-prefixed byte slice.
Format: [length: u64][data: bytes]
§Errors
Returns an error if the write fails.
Sourcepub fn finish_write(&mut self) -> Result<()>
pub fn finish_write(&mut self) -> Result<()>
Finishes writing and flushes buffers.
After this call, the file is ready for reading.
§Errors
Returns an error if the flush fails.
Sourcepub fn is_writable(&self) -> bool
pub fn is_writable(&self) -> bool
Returns whether this file is still in write mode.
Sourcepub fn reader(&self) -> Result<SpillFileReader>
pub fn reader(&self) -> Result<SpillFileReader>
Creates a reader for this file.
Can be called multiple times to create multiple readers.
§Errors
Returns an error if the file cannot be opened for reading.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for SpillFile
impl RefUnwindSafe for SpillFile
impl Send for SpillFile
impl Sync for SpillFile
impl Unpin for SpillFile
impl UnwindSafe for SpillFile
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more