Skip to main content

NativeFile

Struct NativeFile 

Source
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

Source

pub fn from_file(file: File) -> Result<Self>

Transfers ownership of an already-authorized file handle to the runtime.

Source

pub fn set_len_async(&self, size: u64) -> UnitCompletion

Changes the logical file length without blocking the caller’s executor.

Source

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.

Source

pub fn read_batch_async(&self, reads: Vec<OwnedRead>) -> ReadBatch

Submits owned positional reads while retaining this handle.

Source

pub fn write_all_batch_async(&self, writes: Vec<OwnedWrite>) -> UnitCompletion

Submits owned writes while retaining this handle for later operations.

Source

pub fn sync_async(&self, durability: Durability) -> UnitCompletion

Flushes file contents and metadata without blocking the caller’s executor.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more