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§
fn kind(&self) -> FsKind
fn root(&self) -> FileId
fn sector_sizes(&self) -> SectorSizes
fn timestamp_zone(&self) -> TimeZonePolicy
Sourcefn read_dir(&self, ino: FileId) -> VfsResult<DirStream>
fn read_dir(&self, ino: FileId) -> VfsResult<DirStream>
Stream the children of a directory (owned, Send).
Sourcefn extents(&self, ino: FileId, stream: StreamId) -> VfsResult<ExtentStream>
fn extents(&self, ino: FileId, stream: StreamId) -> VfsResult<ExtentStream>
Stream the runs of one data stream of a node (owned, Send).
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>
Sourcefn read_link(&self, ino: FileId, cap: usize) -> VfsResult<Vec<u8>>
fn read_link(&self, ino: FileId, cap: usize) -> VfsResult<Vec<u8>>
Read a symlink target, capped so a hostile symlink cannot allocate without bound.
Sourcefn deleted(&self) -> VfsResult<NodeStream>
fn deleted(&self) -> VfsResult<NodeStream>
Deleted/orphan nodes, streamed (never an eager Vec).
Sourcefn unallocated(&self) -> VfsResult<ExtentStream>
fn unallocated(&self) -> VfsResult<ExtentStream>
Unallocated runs, streamed.
Provided Methods§
fn data_streams(&self, ino: FileId) -> VfsResult<Vec<StreamInfo>>
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".