[−][src]Struct ringbahn::File
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]
fn poll_fill_buf(self: Pin<&mut Self>, ctx: &mut Context) -> Poll<Result<&[u8]>>
[src]
fn consume(self: Pin<&mut Self>, amt: usize)
[src]
impl<D: Drive> AsyncRead for File<D>
[src]
fn poll_read(
self: Pin<&mut Self>,
ctx: &mut Context,
buf: &mut [u8]
) -> Poll<Result<usize>>
[src]
self: Pin<&mut Self>,
ctx: &mut Context,
buf: &mut [u8]
) -> Poll<Result<usize>>
fn poll_read_vectored(
self: Pin<&mut Self>,
cx: &mut Context,
bufs: &mut [IoSliceMut]
) -> Poll<Result<usize, Error>>
[src]
self: Pin<&mut Self>,
cx: &mut Context,
bufs: &mut [IoSliceMut]
) -> Poll<Result<usize, Error>>
impl<D: Drive> AsyncSeek for File<D>
[src]
impl<D: Drive> AsyncWrite for File<D>
[src]
fn poll_write(
self: Pin<&mut Self>,
ctx: &mut Context,
slice: &[u8]
) -> Poll<Result<usize>>
[src]
self: Pin<&mut Self>,
ctx: &mut Context,
slice: &[u8]
) -> Poll<Result<usize>>
fn poll_flush(self: Pin<&mut Self>, ctx: &mut Context) -> Poll<Result<()>>
[src]
fn poll_close(self: Pin<&mut Self>, ctx: &mut Context) -> Poll<Result<()>>
[src]
fn poll_write_vectored(
self: Pin<&mut Self>,
cx: &mut Context,
bufs: &[IoSlice]
) -> Poll<Result<usize, Error>>
[src]
self: Pin<&mut Self>,
cx: &mut Context,
bufs: &[IoSlice]
) -> Poll<Result<usize, Error>>
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,
D: Send,
impl<D> Sync for File<D> where
D: Sync,
D: Sync,
impl<D> Unpin for File<D> where
D: Unpin,
D: Unpin,
impl<D = DemoDriver<'static>> !UnwindSafe for File<D>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,