Skip to main content

Module fs

Module fs 

Source
Expand description

Async file-system operations built on the tempest_io::Io trait.

Each operation is a Future that submits a request to the I/O backend on first poll and resolves when the completion arrives. Partial operations (read_exact, write_exact) retry automatically until the full buffer is transferred.

Structs§

CloseFile
Future that closes a file descriptor.
OpenFile
Future that opens a file and resolves to its file descriptor.
ReadAt
Future that reads from a file at a given offset, resolving to (bytes_read, buf).
ReadExact
Future that reads exactly buf.bytes_total() bytes from a file, retrying on partial reads.
RemoveFile
Future that removes a file at a given path.
StatFile
Future that retrieves file metadata, resolving to Io::Statx.
SyncFile
Future that fsyncs a file descriptor, ensuring data is flushed to storage.
WriteAt
Future that writes to a file at a given offset, resolving to (bytes_written, buf).
WriteExact
Future that writes exactly buf.bytes_init() bytes to a file, retrying on partial writes.

Functions§

close_file
Closes fd, releasing the underlying resource.
list_dir
Lists all entries in dir, returning them as a Vec<DirEntry>.
open_file
Opens path with the given OpenOptions, returning the file descriptor on success.
read_at
Reads from fd into buf at offset. Returns (bytes_read, buf).
read_exact
Reads exactly buf.bytes_total() bytes from fd at offset, retrying on partial reads. Returns (Ok(()), buf) on success, or (Err(e), buf) on I/O error.
remove_file
Removes the file at path.
stat_file
Retrieves metadata for fd, resolving to the platform-specific statx structure.
sync_file
Issues an fsync on fd, resolving when the kernel confirms the flush.
write_at
Writes buf to fd at offset. Returns (bytes_written, buf).
write_exact
Writes exactly buf.bytes_init() bytes from buf to fd at offset, retrying on partials. Returns (Ok(()), buf) on success, or (Err(e), buf) on I/O error.