pub struct Pfs<'a> { /* private fields */ }Expand description
Represents a loaded PFS.
This type is Send + Sync and can be shared across threads via Arc.
All read operations use positional I/O, so concurrent reads from multiple
threads do not require synchronization.
Implementations§
Source§impl<'a> Pfs<'a>
impl<'a> Pfs<'a>
Sourcepub fn inode_count(&self) -> usize
pub fn inode_count(&self) -> usize
Returns the number of inodes in this PFS.
This represents the total number of files and directories in the filesystem.
Sourcepub fn root(self: &Arc<Self>) -> Directory<'a>
pub fn root(self: &Arc<Self>) -> Directory<'a>
Returns the root directory of this PFS.
§Example
let data = std::fs::read("image.pfs")?;
let pfs = orbis_pfs::open_slice(&data, None)?;
// Get the root directory
let root = pfs.root();
// Open and iterate over entries
for (name, entry) in root.open()? {
println!("Entry: {:?}", String::from_utf8_lossy(&name));
}Sourcepub fn block_size(&self) -> u32
pub fn block_size(&self) -> u32
Returns the block size used by this PFS.
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for Pfs<'a>
impl<'a> !RefUnwindSafe for Pfs<'a>
impl<'a> Unpin for Pfs<'a>
impl<'a> !UnwindSafe for Pfs<'a>
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