pub struct EngramFS { /* private fields */ }Expand description
The EngramFS FUSE filesystem implementation
This provides a read-only view of decoded engram data as a standard POSIX filesystem. Files are decoded on-demand from the holographic representation and cached for efficient repeated access.
Implementations§
Source§impl EngramFS
impl EngramFS
Sourcepub fn new(read_only: bool) -> Self
pub fn new(read_only: bool) -> Self
Create a new EngramFS instance
§Arguments
read_only- Whether the filesystem is read-only (default: true for engrams)
Sourcepub fn lookup_path(&self, path: &str) -> Option<Ino>
pub fn lookup_path(&self, path: &str) -> Option<Ino>
Lookup a path and return its inode
Sourcepub fn lookup_entry(&self, parent_ino: Ino, name: &str) -> Option<Ino>
pub fn lookup_entry(&self, parent_ino: Ino, name: &str) -> Option<Ino>
Lookup entry in directory by name
Sourcepub fn get_parent(&self, ino: Ino) -> Option<Ino>
pub fn get_parent(&self, ino: Ino) -> Option<Ino>
Get parent inode for a given inode
Sourcepub fn file_count(&self) -> usize
pub fn file_count(&self) -> usize
Get total number of files
Sourcepub fn total_size(&self) -> u64
pub fn total_size(&self) -> u64
Get total size of all files
Sourcepub fn is_read_only(&self) -> bool
pub fn is_read_only(&self) -> bool
Check if filesystem is read-only
Sourcepub fn add_device(
&self,
path: &str,
is_char: bool,
major: u32,
minor: u32,
data: Vec<u8>,
) -> Result<Ino, &'static str>
pub fn add_device( &self, path: &str, is_char: bool, major: u32, minor: u32, data: Vec<u8>, ) -> Result<Ino, &'static str>
Add a device node to the filesystem (Option C: store device data)
§Arguments
path- Absolute path within the filesystem (e.g., “/dev/null”)is_char- true for character device, false for block devicemajor- Major device numberminor- Minor device numberdata- Device data content (Option C encoding)
§Returns
The assigned inode number for the new device
Sourcepub fn add_fifo(&self, path: &str) -> Result<Ino, &'static str>
pub fn add_fifo(&self, path: &str) -> Result<Ino, &'static str>
Add a FIFO (named pipe) to the filesystem
Sourcepub fn add_socket(&self, path: &str) -> Result<Ino, &'static str>
pub fn add_socket(&self, path: &str) -> Result<Ino, &'static str>
Add a Unix socket to the filesystem
Sourcepub fn read_symlink(&self, ino: Ino) -> Option<String>
pub fn read_symlink(&self, ino: Ino) -> Option<String>
Read symlink target
Sourcepub fn get_device(&self, ino: Ino) -> Option<DeviceNode>
pub fn get_device(&self, ino: Ino) -> Option<DeviceNode>
Get device node info
Sourcepub fn symlink_count(&self) -> usize
pub fn symlink_count(&self) -> usize
Get total number of symlinks
Sourcepub fn device_count(&self) -> usize
pub fn device_count(&self) -> usize
Get total number of device nodes
Auto Trait Implementations§
impl Freeze for EngramFS
impl RefUnwindSafe for EngramFS
impl Send for EngramFS
impl Sync for EngramFS
impl Unpin for EngramFS
impl UnwindSafe for EngramFS
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more