Struct MemoryFileSystem

Source
pub struct MemoryFileSystem<'a> { /* private fields */ }
Expand description

A in-memory file system.

Implementations§

Source§

impl<'a> MemoryFileSystem<'a>

Source

pub const fn new( files: &'a [(&'a [u8], &'a [u8])], entries: &'a mut [Option<MemoryFileEntry>], ) -> Self

Creates a file system.

Trait Implementations§

Source§

impl<'a> Debug for MemoryFileSystem<'a>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl FileSystem for MemoryFileSystem<'_>

Source§

type Path = [u8]

A path.
Source§

type PathBuf = Vec<u8, PATH_SIZE>

A path buffer.
Source§

type Error = FileError

An error.
Source§

fn open( &mut self, path: &Self::Path, output: bool, ) -> Result<FileDescriptor, Self::Error>

Opens a file and returns its descriptor.
Source§

fn close(&mut self, descriptor: FileDescriptor) -> Result<(), Self::Error>

Closes a file.
Source§

fn read(&mut self, descriptor: FileDescriptor) -> Result<u8, Self::Error>

Reads a file.
Source§

fn write(&mut self, _: FileDescriptor, _: u8) -> Result<(), Self::Error>

Writes a file.
Source§

fn delete(&mut self, _: &Self::Path) -> Result<(), Self::Error>

Deletes a file.
Source§

fn exists(&self, path: &Self::Path) -> Result<bool, Self::Error>

Checks if a file exists.
Source§

fn decode_path( memory: &Memory<'_>, list: Value, ) -> Result<Self::PathBuf, Self::Error>

Decodes a path.

Auto Trait Implementations§

§

impl<'a> Freeze for MemoryFileSystem<'a>

§

impl<'a> RefUnwindSafe for MemoryFileSystem<'a>

§

impl<'a> Send for MemoryFileSystem<'a>

§

impl<'a> Sync for MemoryFileSystem<'a>

§

impl<'a> Unpin for MemoryFileSystem<'a>

§

impl<'a> !UnwindSafe for MemoryFileSystem<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.