Skip to main content

RamFileSystem

Struct RamFileSystem 

Source
pub struct RamFileSystem { /* private fields */ }

Implementations§

Source§

impl RamFileSystem

Source

pub fn new() -> Self

Creates a new instance.

Source

pub fn resolve_path_internal(&self, path: &str) -> FsResult<u64>

Internal helper to resolve path to inode (used by IPC server)

Source

pub fn register_open(&self, ino: u64) -> FsResult<()>

Implements register open.

Source

pub fn unregister_open(&self, ino: u64) -> FsResult<()>

Implements unregister open.

Trait Implementations§

Source§

impl VfsFileSystem for RamFileSystem

Source§

fn fs_type(&self) -> &'static str

Implements fs type.

Source§

fn capabilities(&self) -> &FsCapabilities

Implements capabilities.

Source§

fn root_inode(&self) -> u64

Implements root inode.

Source§

fn get_volume_info(&self) -> FsResult<VfsVolumeInfo>

Returns volume info.

Source§

fn stat(&self, ino: u64) -> FsResult<VfsFileInfo>

Implements stat.

Source§

fn lookup(&self, parent_ino: u64, name: &str) -> FsResult<VfsFileInfo>

Implements lookup.

Source§

fn resolve_path(&self, path: &str) -> FsResult<u64>

Implements resolve path.

Source§

fn read(&self, ino: u64, offset: u64, buf: &mut [u8]) -> FsResult<usize>

Implements read.

Source§

fn write(&self, ino: u64, offset: u64, data: &[u8]) -> FsResult<usize>

Implements write.

Source§

fn readdir(&self, ino: u64) -> FsResult<Vec<VfsDirEntry>>

Implements readdir.

Source§

fn create_file( &self, parent_ino: u64, name: &str, mode: u32, ) -> FsResult<VfsFileInfo>

Implements create file.

Source§

fn create_directory( &self, parent_ino: u64, name: &str, mode: u32, ) -> FsResult<VfsFileInfo>

Implements create directory.

Implements unlink.

Source§

fn rename( &self, old_parent: u64, old_name: &str, new_parent: u64, new_name: &str, flags: RenameFlags, ) -> FsResult<()>

Implements rename.

Source§

fn set_size(&self, ino: u64, size: u64) -> FsResult<()>

Sets size.

Source§

fn set_times( &self, ino: u64, _atime: Option<VfsTimestamp>, _mtime: Option<VfsTimestamp>, ) -> FsResult<()>

Sets times.

Implements readlink.

Source§

fn invalidate_inode(&self, _ino: u64)

Implements invalidate inode.

Source§

fn invalidate_all_caches(&self)

Implements invalidate all caches.

Source§

fn sync(&self) -> Result<(), FsError>

Synchronizes all pending writes to disk. Read more
Creates a symbolic link. Read more
Creates a hard link. Read more

Auto Trait Implementations§

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.
Source§

impl<T> VfsFileSystemExt for T
where T: VfsFileSystem + 'static,

Source§

fn into_arc(self) -> Arc<dyn VfsFileSystem>

Implements into arc.