pub trait ForensicFs {
Show 15 methods
// Required methods
fn root_ino(&self) -> u64;
fn read_dir(&mut self, ino: u64) -> FsResult<Vec<FsDirEntry>>;
fn lookup(&mut self, parent_ino: u64, name: &[u8]) -> FsResult<Option<u64>>;
fn metadata(&mut self, ino: u64) -> FsResult<FsMetadata>;
fn read_file(&mut self, ino: u64) -> FsResult<Vec<u8>>;
fn read_file_range(
&mut self,
ino: u64,
offset: u64,
len: u64,
) -> FsResult<Vec<u8>>;
fn read_link(&mut self, ino: u64) -> FsResult<Vec<u8>>;
// Provided methods
fn deleted_inodes(&mut self) -> FsResult<Vec<FsDeletedInode>> { ... }
fn recover_file(&mut self, _ino: u64) -> FsResult<FsRecoveryResult> { ... }
fn timeline(&mut self) -> FsResult<Vec<FsTimelineEvent>> { ... }
fn unallocated_blocks(&mut self) -> FsResult<Vec<FsBlockRange>> { ... }
fn read_unallocated(&mut self, _range: &FsBlockRange) -> FsResult<Vec<u8>> { ... }
fn journal_transactions(&mut self) -> FsResult<Vec<FsTransaction>> { ... }
fn fs_info(&self) -> FsResult<Value> { ... }
fn block_size(&self) -> u64 { ... }
}Expand description
The core trait that filesystem crates implement.
Provides both standard filesystem access (required methods) and forensic operations (optional, with sensible defaults).
Required Methods§
Sourcefn read_dir(&mut self, ino: u64) -> FsResult<Vec<FsDirEntry>>
fn read_dir(&mut self, ino: u64) -> FsResult<Vec<FsDirEntry>>
List directory entries for the given inode.
Sourcefn lookup(&mut self, parent_ino: u64, name: &[u8]) -> FsResult<Option<u64>>
fn lookup(&mut self, parent_ino: u64, name: &[u8]) -> FsResult<Option<u64>>
Look up a name in a directory, returning the child inode if found.
Sourcefn metadata(&mut self, ino: u64) -> FsResult<FsMetadata>
fn metadata(&mut self, ino: u64) -> FsResult<FsMetadata>
Get file/directory metadata for an inode.
Provided Methods§
Sourcefn deleted_inodes(&mut self) -> FsResult<Vec<FsDeletedInode>>
fn deleted_inodes(&mut self) -> FsResult<Vec<FsDeletedInode>>
List deleted inodes.
Sourcefn recover_file(&mut self, _ino: u64) -> FsResult<FsRecoveryResult>
fn recover_file(&mut self, _ino: u64) -> FsResult<FsRecoveryResult>
Attempt to recover a deleted file by inode number.
Sourcefn timeline(&mut self) -> FsResult<Vec<FsTimelineEvent>>
fn timeline(&mut self) -> FsResult<Vec<FsTimelineEvent>>
Generate a forensic timeline of all filesystem events.
Sourcefn unallocated_blocks(&mut self) -> FsResult<Vec<FsBlockRange>>
fn unallocated_blocks(&mut self) -> FsResult<Vec<FsBlockRange>>
Get all unallocated block ranges.
Sourcefn read_unallocated(&mut self, _range: &FsBlockRange) -> FsResult<Vec<u8>>
fn read_unallocated(&mut self, _range: &FsBlockRange) -> FsResult<Vec<u8>>
Read raw data from an unallocated block range.
Sourcefn journal_transactions(&mut self) -> FsResult<Vec<FsTransaction>>
fn journal_transactions(&mut self) -> FsResult<Vec<FsTransaction>>
List journal transactions.
Sourcefn fs_info(&self) -> FsResult<Value>
fn fs_info(&self) -> FsResult<Value>
Get filesystem-specific info as JSON (superblock, volume label, etc.).
Sourcefn block_size(&self) -> u64
fn block_size(&self) -> u64
The block size of this filesystem.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".