pub trait FileSystem {
type Error: Error;
// Required methods
fn open(
&self,
path: &[u8],
output: bool,
) -> Result<FileDescriptor, Self::Error>;
fn close(&self, descriptor: FileDescriptor) -> Result<(), Self::Error>;
fn read(&self, descriptor: FileDescriptor) -> Result<u8, Self::Error>;
fn write(
&self,
descriptor: FileDescriptor,
byte: u8,
) -> Result<(), Self::Error>;
fn delete(&self, path: &[u8]) -> Result<(), Self::Error>;
fn exists(&self, path: &[u8]) -> Result<bool, Self::Error>;
}
Expand description
A file system.