Skip to main content

FileSystem

Trait FileSystem 

Source
pub trait FileSystem: Send + Sync {
Show 15 methods // Required methods fn kind(&self) -> FsKind; fn root(&self) -> FileId; fn sector_sizes(&self) -> SectorSizes; fn timestamp_zone(&self) -> TimeZonePolicy; fn read_dir(&self, ino: FileId) -> VfsResult<DirStream>; fn extents(&self, ino: FileId, stream: StreamId) -> VfsResult<ExtentStream>; fn lookup(&self, parent: FileId, name: &[u8]) -> VfsResult<Option<FileId>>; fn meta(&self, ino: FileId) -> VfsResult<FsMeta>; fn read_at( &self, ino: FileId, stream: StreamId, off: u64, buf: &mut [u8], ) -> VfsResult<usize>; fn read_link(&self, ino: FileId, cap: usize) -> VfsResult<Vec<u8>>; fn deleted(&self) -> VfsResult<NodeStream>; fn unallocated(&self) -> VfsResult<ExtentStream>; // Provided methods fn data_streams(&self, ino: FileId) -> VfsResult<Vec<StreamInfo>> { ... } fn hardlinks(&self, ino: FileId) -> VfsResult<Vec<HardLink>> { ... } fn slack(&self, ino: FileId, stream: StreamId) -> VfsResult<Option<ByteRun>> { ... }
}
Expand description

One mounted, read-only filesystem. Inode-addressed; &self reads share one handle across workers; internal caches use interior mutability, never &mut self.

Required Methods§

Source

fn kind(&self) -> FsKind

Source

fn root(&self) -> FileId

Source

fn sector_sizes(&self) -> SectorSizes

Source

fn timestamp_zone(&self) -> TimeZonePolicy

Source

fn read_dir(&self, ino: FileId) -> VfsResult<DirStream>

Stream the children of a directory (owned, Send).

Source

fn extents(&self, ino: FileId, stream: StreamId) -> VfsResult<ExtentStream>

Stream the runs of one data stream of a node (owned, Send).

Source

fn lookup(&self, parent: FileId, name: &[u8]) -> VfsResult<Option<FileId>>

Source

fn meta(&self, ino: FileId) -> VfsResult<FsMeta>

Source

fn read_at( &self, ino: FileId, stream: StreamId, off: u64, buf: &mut [u8], ) -> VfsResult<usize>

Read a symlink target, capped so a hostile symlink cannot allocate without bound.

Source

fn deleted(&self) -> VfsResult<NodeStream>

Deleted/orphan nodes, streamed (never an eager Vec).

Source

fn unallocated(&self) -> VfsResult<ExtentStream>

Unallocated runs, streamed.

Provided Methods§

Source

fn data_streams(&self, ino: FileId) -> VfsResult<Vec<StreamInfo>>

Hardlink back-references (capped by the implementation).

Source

fn slack(&self, ino: FileId, stream: StreamId) -> VfsResult<Option<ByteRun>>

File slack for a stream, if the FS exposes it.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§