Trait seed_riscv::fs::Filesystem

source ·
pub trait Filesystem {
    // Required methods
    fn load(&mut self, path: &str) -> Result<File<'_>, ()>;
    fn close(&mut self, file: File<'_>);
}
Expand description

A Filesystem represents something that can meaningfully contain ‘files’ - discrete chunks of data addressed using paths. For Seed, this is generally going to be a real filesystem that occupies a partition on a block device, either real or virtual, or the very simple ‘filesystem’ provided by the ramdisk used on some platforms.

This interface (at the moment, at least) is much simpler than a ‘real’ one. You can simply load a file in its entirity into memory, and then close it once you’re done with it. In the future, this could be made smarter, but is probably sufficient for a bootloader as is.

Required Methods§

source

fn load(&mut self, path: &str) -> Result<File<'_>, ()>

source

fn close(&mut self, file: File<'_>)

Implementors§