pub struct NativeFile { /* private fields */ }Expand description
One file owned by the native I/O runtime.
Callers retain responsibility for capability-safe path resolution and pass the resulting handle here exactly once. Operations submitted through this handle execute in first-poll order. Creating an operation is lazy: an unpolled future neither submits I/O nor delays later operations. Once an operation has been polled, dropping its observer does not overtake earlier admitted work.
Implementations§
Source§impl NativeFile
impl NativeFile
Sourcepub fn from_file(file: File) -> Result<Self>
pub fn from_file(file: File) -> Result<Self>
Transfers ownership of an already-authorized file handle to the runtime.
Sourcepub fn set_len_async(&self, size: u64) -> UnitCompletion
pub fn set_len_async(&self, size: u64) -> UnitCompletion
Changes the logical file length without blocking the caller’s executor.
Sourcepub fn control_async(
&self,
operation: impl FnOnce(&File) -> Result<()> + Send + 'static,
) -> UnitCompletion
pub fn control_async( &self, operation: impl FnOnce(&File) -> Result<()> + Send + 'static, ) -> UnitCompletion
Runs a platform-specific handle control in this file’s operation order. The closure owns no borrowed handle after completion and executes off the caller’s async executor when native completion is unavailable.
Sourcepub fn read_batch_async(&self, reads: Vec<OwnedRead>) -> ReadBatch
pub fn read_batch_async(&self, reads: Vec<OwnedRead>) -> ReadBatch
Submits owned positional reads while retaining this handle.
Sourcepub fn write_all_batch_async(&self, writes: Vec<OwnedWrite>) -> UnitCompletion
pub fn write_all_batch_async(&self, writes: Vec<OwnedWrite>) -> UnitCompletion
Submits owned writes while retaining this handle for later operations.
Sourcepub fn sync_async(&self, durability: Durability) -> UnitCompletion
pub fn sync_async(&self, durability: Durability) -> UnitCompletion
Flushes file contents and metadata without blocking the caller’s executor.