pub trait FileHandle {
// Required methods
fn name(&self) -> &str;
fn url(&self) -> String;
fn size(&self) -> FileSizeFuture;
fn read_at<'a>(
&'a self,
offset: u64,
buf: &'a mut [u8],
) -> FileReadFuture<'a>;
fn open_write(&self) -> Option<FileOpenFuture<Box<dyn FileWriter>>>;
}Expand description
A picked file the system gives no path for, read and written at any offset.
Required Methods§
fn size(&self) -> FileSizeFuture
Sourcefn read_at<'a>(&'a self, offset: u64, buf: &'a mut [u8]) -> FileReadFuture<'a>
fn read_at<'a>(&'a self, offset: u64, buf: &'a mut [u8]) -> FileReadFuture<'a>
Reads into buf from offset; answers how many bytes it read, 0 at the end.
Sourcefn open_write(&self) -> Option<FileOpenFuture<Box<dyn FileWriter>>>
fn open_write(&self) -> Option<FileOpenFuture<Box<dyn FileWriter>>>
Opens the file to write; None unless the pick is writable.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".