[][src]Struct ringbahn::File

pub struct File<D: Drive = DemoDriver<'static>> { /* fields omitted */ }

A file handle that runs on io-uring

Implementations

impl File[src]

pub fn open(path: impl AsRef<Path>) -> Open[src]

Open a file using the default driver

pub fn create(path: impl AsRef<Path>) -> Create[src]

Create a new file using the default driver

impl<D: Drive + Clone> File<D>[src]

pub fn open_on_driver(path: impl AsRef<Path>, driver: D) -> Open<D>[src]

Open a file

pub fn create_on_driver(path: impl AsRef<Path>, driver: D) -> Create<D>[src]

Create a file

impl<D: Drive> File<D>[src]

pub fn run_on_driver(file: File, driver: D) -> File<D>[src]

Take an existing file and run its IO on an io-uring driver

pub fn read_buffered(&self) -> &[u8][src]

Access any data that has been read into the buffer, but not consumed

This is similar to the fill_buf method from AsyncBufRead, but instead of performing IO if the buffer is empty, it will just return an empty slice. This method can be used to copy out any left over buffered data before closing or performing a write.

Trait Implementations

impl<D: Drive> AsyncBufRead for File<D>[src]

impl<D: Drive> AsyncRead for File<D>[src]

impl<D: Drive> AsyncSeek for File<D>[src]

impl<D: Drive> AsyncWrite for File<D>[src]

impl<D: Drive> Drop for File<D>[src]

impl<D: Drive> From<File<D>> for File[src]

impl From<File> for File[src]

Auto Trait Implementations

impl<D = DemoDriver<'static>> !RefUnwindSafe for File<D>

impl<D> Send for File<D> where
    D: Send

impl<D> Sync for File<D> where
    D: Sync

impl<D> Unpin for File<D> where
    D: Unpin

impl<D = DemoDriver<'static>> !UnwindSafe for File<D>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.