pub trait FileSystemExt {
// Required methods
fn read_all(&self, path: &FsPath) -> FsResult<Vec<u8>>;
fn write_all(&self, path: &FsPath, bytes: &[u8]) -> FsResult<WriteOutcome>;
}Expand description
Convenience methods for filesystem trait objects.
Required Methods§
Sourcefn read_all(&self, path: &FsPath) -> FsResult<Vec<u8>>
fn read_all(&self, path: &FsPath) -> FsResult<Vec<u8>>
Reads an entire resource into memory.
§Parameters
path: Resource path.
§Returns
Resource bytes.
§Errors
Returns crate::FsError when opening or reading fails.
Sourcefn write_all(&self, path: &FsPath, bytes: &[u8]) -> FsResult<WriteOutcome>
fn write_all(&self, path: &FsPath, bytes: &[u8]) -> FsResult<WriteOutcome>
Writes an entire resource and commits the writer.
§Parameters
path: Resource path.bytes: Bytes to write.
§Returns
Write outcome.
§Errors
Returns crate::FsError when opening, writing, or committing fails.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".