Enum File

Source
pub enum File {
    Tokio(File),
    Uring(File),
}
Expand description

An adapter enum to support both tokio and tokio-uring asynchronous File.

Variants§

§

Tokio(File)

Tokio asynchronous File.

§

Uring(File)

Tokio-uring asynchronous File.

Implementations§

Source§

impl File

Source

pub async fn async_open<P: AsRef<Path>>( path: P, write: bool, create: bool, ) -> Result<Self>

Asynchronously open a file.

Source

pub async fn async_read_at( &self, buf: FileVolatileBuf, offset: u64, ) -> (Result<usize>, FileVolatileBuf)

Asynchronously read data at offset into the buffer.

Source

pub async fn async_readv_at( &self, bufs: Vec<FileVolatileBuf>, offset: u64, ) -> (Result<usize>, Vec<FileVolatileBuf>)

Asynchronously read data at offset into buffers.

Source

pub async fn async_write_at( &self, buf: FileVolatileBuf, offset: u64, ) -> (Result<usize>, FileVolatileBuf)

Asynchronously write data at offset from the buffer.

Source

pub async fn async_writev_at( &self, bufs: Vec<FileVolatileBuf>, offset: u64, ) -> (Result<usize>, Vec<FileVolatileBuf>)

Asynchronously write data at offset from buffers.

Source

pub fn metadata(&self) -> Result<Metadata>

Get metadata about the file.

Source

pub async fn async_try_clone(&self) -> Result<Self>

Try to clone the file object.

Trait Implementations§

Source§

impl AsRawFd for File

Source§

fn as_raw_fd(&self) -> RawFd

Extracts the raw file descriptor. Read more
Source§

impl AsyncFileReadWriteVolatile for File

Source§

fn async_read_at_volatile<'life0, 'async_trait>( &'life0 self, buf: FileVolatileBuf, offset: u64, ) -> Pin<Box<dyn Future<Output = (Result<usize>, FileVolatileBuf)> + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Read bytes from this file at offset into the given slice in asynchronous mode. Read more
Source§

fn async_read_vectored_at_volatile<'life0, 'async_trait>( &'life0 self, bufs: Vec<FileVolatileBuf>, offset: u64, ) -> Pin<Box<dyn Future<Output = (Result<usize>, Vec<FileVolatileBuf>)> + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Asynchronous version of FileReadWriteVolatile::read_vectored_at_volatile, to read data into FileVolatileSlice buffers. Read more
Source§

fn async_write_at_volatile<'life0, 'async_trait>( &'life0 self, buf: FileVolatileBuf, offset: u64, ) -> Pin<Box<dyn Future<Output = (Result<usize>, FileVolatileBuf)> + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Asynchronous version of FileReadWriteVolatile::write_at_volatile, to write data from a FileVolatileSlice buffer.
Source§

fn async_write_vectored_at_volatile<'life0, 'async_trait>( &'life0 self, bufs: Vec<FileVolatileBuf>, offset: u64, ) -> Pin<Box<dyn Future<Output = (Result<usize>, Vec<FileVolatileBuf>)> + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Asynchronous version of FileReadWriteVolatile::write_vectored_at_volatile, to write data from FileVolatileSlice buffers.
Source§

impl Debug for File

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl !Freeze for File

§

impl !RefUnwindSafe for File

§

impl !Send for File

§

impl !Sync for File

§

impl Unpin for File

§

impl !UnwindSafe for File

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, 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 = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.