pub struct LinuxReadOnlyEngine<B> { /* private fields */ }Expand description
Product-neutral read-only engine shared by native FUSE callbacks and deterministic tests.
Implementations§
Source§impl<B> LinuxReadOnlyEngine<B>where
B: CloudFilesBackend + 'static,
impl<B> LinuxReadOnlyEngine<B>where
B: CloudFilesBackend + 'static,
Sourcepub fn new(
backend: Arc<B>,
inodes: Arc<LinuxInodeTable>,
attributes: LinuxAttributePolicy,
) -> Self
pub fn new( backend: Arc<B>, inodes: Arc<LinuxInodeTable>, attributes: LinuxAttributePolicy, ) -> Self
Creates a read-only engine from a backend, restored inode table, and attribute policy.
Sourcepub fn inode_table(&self) -> &LinuxInodeTable
pub fn inode_table(&self) -> &LinuxInodeTable
Returns the active immutable inode table.
Sourcepub fn attribute_policy(&self) -> &LinuxAttributePolicy
pub fn attribute_policy(&self) -> &LinuxAttributePolicy
Returns the active native attribute policy.
Sourcepub async fn lookup(&self, parent: LinuxInode, name: &str) -> Result<LinuxNode>
pub async fn lookup(&self, parent: LinuxInode, name: &str) -> Result<LinuxNode>
Resolves one name by enumerating all backend pages for the parent snapshot.
§Errors
Returns an error when validation fails or an underlying backend, store, or platform operation fails.
Sourcepub async fn getattr(&self, inode: LinuxInode) -> Result<LinuxNode>
pub async fn getattr(&self, inode: LinuxInode) -> Result<LinuxNode>
Loads attributes for one restored inode.
§Errors
Returns an error when validation fails or an underlying backend, store, or platform operation fails.
Sourcepub async fn open_file(&self, inode: LinuxInode) -> Result<LinuxFileHandle>
pub async fn open_file(&self, inode: LinuxInode) -> Result<LinuxFileHandle>
Opens a regular file and captures its exact content revision for subsequent range reads.
§Errors
Returns an error when validation fails or an underlying backend, store, or platform operation fails.
Sourcepub async fn read_file(
&self,
inode: LinuxInode,
handle: LinuxFileHandle,
offset: u64,
size: u32,
) -> Result<Bytes>
pub async fn read_file( &self, inode: LinuxInode, handle: LinuxFileHandle, offset: u64, size: u32, ) -> Result<Bytes>
Reads an exact range using the revision captured by open_file.
§Errors
Returns an error when validation fails or an underlying backend, store, or platform operation fails.
Sourcepub fn release_file(&self, handle: LinuxFileHandle) -> Result<()>
pub fn release_file(&self, handle: LinuxFileHandle) -> Result<()>
Releases one file handle. Releasing the same handle twice reports a stale handle.
§Errors
Returns an error when validation fails or an underlying backend, store, or platform operation fails.
Sourcepub async fn open_directory(
&self,
inode: LinuxInode,
) -> Result<LinuxDirectoryHandle>
pub async fn open_directory( &self, inode: LinuxInode, ) -> Result<LinuxDirectoryHandle>
Opens a directory and freezes one complete paged snapshot for stable FUSE cookies.
§Errors
Returns an error when validation fails or an underlying backend, store, or platform operation fails.
Sourcepub fn directory_snapshot(
&self,
inode: LinuxInode,
handle: LinuxDirectoryHandle,
) -> Result<LinuxDirectorySnapshot>
pub fn directory_snapshot( &self, inode: LinuxInode, handle: LinuxDirectoryHandle, ) -> Result<LinuxDirectorySnapshot>
Returns the immutable snapshot associated with an open directory handle.
§Errors
Returns an error when validation fails or an underlying backend, store, or platform operation fails.
Sourcepub fn release_directory(&self, handle: LinuxDirectoryHandle) -> Result<()>
pub fn release_directory(&self, handle: LinuxDirectoryHandle) -> Result<()>
Releases one directory snapshot handle.
§Errors
Returns an error when validation fails or an underlying backend, store, or platform operation fails.