VirtualFs

Trait VirtualFs 

Source
pub trait VirtualFs: Sync + Send {
Show 35 methods // Required methods fn lookup<'life0, 'life1, 'async_trait>( &'life0 self, uid: u32, gid: u32, parent: INum, name: &'life1 str, ) -> Pin<Box<dyn Future<Output = AsyncFusexResult<(Duration, FileAttr, u64)>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn forget<'life0, 'async_trait>( &'life0 self, ino: u64, nlookup: u64, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn getattr<'life0, 'async_trait>( &'life0 self, ino: u64, ) -> Pin<Box<dyn Future<Output = AsyncFusexResult<(Duration, FileAttr)>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn setattr<'life0, 'async_trait>( &'life0 self, uid: u32, gid: u32, ino: u64, param: SetAttrParam, ) -> Pin<Box<dyn Future<Output = AsyncFusexResult<(Duration, FileAttr)>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn readlink<'life0, 'async_trait>( &'life0 self, ino: u64, ) -> Pin<Box<dyn Future<Output = AsyncFusexResult<Vec<u8>>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn mknod<'life0, 'async_trait>( &'life0 self, param: CreateParam, ) -> Pin<Box<dyn Future<Output = AsyncFusexResult<(Duration, FileAttr, u64)>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn mkdir<'life0, 'async_trait>( &'life0 self, param: CreateParam, ) -> Pin<Box<dyn Future<Output = AsyncFusexResult<(Duration, FileAttr, u64)>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn unlink<'life0, 'life1, 'async_trait>( &'life0 self, uid: u32, gid: u32, parent: INum, name: &'life1 str, ) -> Pin<Box<dyn Future<Output = AsyncFusexResult<()>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn rmdir<'life0, 'life1, 'async_trait>( &'life0 self, uid: u32, gid: u32, parent: INum, dir_name: &'life1 str, ) -> Pin<Box<dyn Future<Output = AsyncFusexResult<Option<INum>>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn symlink<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, uid: u32, gid: u32, parent: INum, name: &'life1 str, target_path: &'life2 Path, ) -> Pin<Box<dyn Future<Output = AsyncFusexResult<(Duration, FileAttr, u64)>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait; fn rename<'life0, 'async_trait>( &'life0 self, uid: u32, gid: u32, param: RenameParam, ) -> Pin<Box<dyn Future<Output = AsyncFusexResult<()>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn open<'life0, 'async_trait>( &'life0 self, uid: u32, gid: u32, ino: u64, flags: u32, ) -> Pin<Box<dyn Future<Output = AsyncFusexResult<u64>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn read<'life0, 'life1, 'async_trait>( &'life0 self, ino: u64, offset: u64, size: u32, buf: &'life1 mut Vec<u8>, ) -> Pin<Box<dyn Future<Output = AsyncFusexResult<usize>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn write<'life0, 'life1, 'async_trait>( &'life0 self, ino: u64, offset: i64, data: &'life1 [u8], flags: u32, ) -> Pin<Box<dyn Future<Output = AsyncFusexResult<()>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn flush<'life0, 'async_trait>( &'life0 self, ino: u64, lock_owner: u64, ) -> Pin<Box<dyn Future<Output = AsyncFusexResult<()>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn release<'life0, 'async_trait>( &'life0 self, ino: u64, flags: u32, lock_owner: u64, flush: bool, ) -> Pin<Box<dyn Future<Output = AsyncFusexResult<()>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn fsync<'life0, 'async_trait>( &'life0 self, ino: u64, datasync: bool, ) -> Pin<Box<dyn Future<Output = AsyncFusexResult<()>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn opendir<'life0, 'async_trait>( &'life0 self, uid: u32, gid: u32, ino: u64, flags: u32, ) -> Pin<Box<dyn Future<Output = AsyncFusexResult<u64>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn readdir<'life0, 'async_trait>( &'life0 self, uid: u32, gid: u32, ino: u64, fh: u64, offset: i64, ) -> Pin<Box<dyn Future<Output = AsyncFusexResult<Vec<DirEntry>>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn releasedir<'life0, 'async_trait>( &'life0 self, ino: u64, fh: u64, flags: u32, ) -> Pin<Box<dyn Future<Output = AsyncFusexResult<()>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn fsyncdir<'life0, 'async_trait>( &'life0 self, ino: u64, fh: u64, datasync: bool, ) -> Pin<Box<dyn Future<Output = AsyncFusexResult<()>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn statfs<'life0, 'async_trait>( &'life0 self, uid: u32, gid: u32, ino: u64, ) -> Pin<Box<dyn Future<Output = AsyncFusexResult<StatFsParam>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; // Provided methods fn init<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = AsyncFusexResult<()>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait { ... } fn destroy<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = AsyncFusexResult<()>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait { ... } fn interrupt<'life0, 'async_trait>( &'life0 self, unique: u64, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait { ... } fn link<'life0, 'life1, 'async_trait>( &'life0 self, newparent: u64, newname: &'life1 str, ) -> Pin<Box<dyn Future<Output = AsyncFusexResult<()>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait { ... } fn setxattr<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, ino: u64, name: &'life1 str, value: &'life2 [u8], flags: u32, position: u32, ) -> Pin<Box<dyn Future<Output = AsyncFusexResult<()>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait { ... } fn getxattr<'life0, 'life1, 'async_trait>( &'life0 self, ino: u64, name: &'life1 str, size: u32, ) -> Pin<Box<dyn Future<Output = AsyncFusexResult<()>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait { ... } fn listxattr<'life0, 'async_trait>( &'life0 self, ino: u64, size: u32, ) -> Pin<Box<dyn Future<Output = AsyncFusexResult<()>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait { ... } fn removexattr<'life0, 'life1, 'async_trait>( &'life0 self, ino: u64, name: &'life1 str, ) -> Pin<Box<dyn Future<Output = AsyncFusexResult<()>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait { ... } fn access<'life0, 'async_trait>( &'life0 self, uid: u32, gid: u32, ino: u64, mask: u32, ) -> Pin<Box<dyn Future<Output = AsyncFusexResult<()>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait { ... } fn create<'life0, 'life1, 'async_trait>( &'life0 self, uid: u32, gid: u32, ino: u64, parent: u64, name: &'life1 str, mode: u32, flags: u32, ) -> Pin<Box<dyn Future<Output = AsyncFusexResult<()>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait { ... } fn getlk<'life0, 'async_trait>( &'life0 self, uid: u32, gid: u32, ino: u64, lk_param: FileLockParam, ) -> Pin<Box<dyn Future<Output = AsyncFusexResult<()>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait { ... } fn setlk<'life0, 'async_trait>( &'life0 self, uid: u32, gid: u32, ino: u64, lk_param: FileLockParam, sleep: bool, ) -> Pin<Box<dyn Future<Output = AsyncFusexResult<()>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait { ... } fn bmap<'life0, 'async_trait>( &'life0 self, uid: u32, gid: u32, ino: u64, blocksize: u32, idx: u64, ) -> Pin<Box<dyn Future<Output = AsyncFusexResult<()>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait { ... }
}
Expand description

Virtual filesystem trait

Required Methods§

Source

fn lookup<'life0, 'life1, 'async_trait>( &'life0 self, uid: u32, gid: u32, parent: INum, name: &'life1 str, ) -> Pin<Box<dyn Future<Output = AsyncFusexResult<(Duration, FileAttr, u64)>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Look up a directory entry by name and get its attributes.

Source

fn forget<'life0, 'async_trait>( &'life0 self, ino: u64, nlookup: u64, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Forget about an inode

Source

fn getattr<'life0, 'async_trait>( &'life0 self, ino: u64, ) -> Pin<Box<dyn Future<Output = AsyncFusexResult<(Duration, FileAttr)>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get file attributes.

Source

fn setattr<'life0, 'async_trait>( &'life0 self, uid: u32, gid: u32, ino: u64, param: SetAttrParam, ) -> Pin<Box<dyn Future<Output = AsyncFusexResult<(Duration, FileAttr)>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Set file attributes.

Read symbolic link.

Source

fn mknod<'life0, 'async_trait>( &'life0 self, param: CreateParam, ) -> Pin<Box<dyn Future<Output = AsyncFusexResult<(Duration, FileAttr, u64)>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Create file node.

Source

fn mkdir<'life0, 'async_trait>( &'life0 self, param: CreateParam, ) -> Pin<Box<dyn Future<Output = AsyncFusexResult<(Duration, FileAttr, u64)>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Create a directory

Remove a file

Source

fn rmdir<'life0, 'life1, 'async_trait>( &'life0 self, uid: u32, gid: u32, parent: INum, dir_name: &'life1 str, ) -> Pin<Box<dyn Future<Output = AsyncFusexResult<Option<INum>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Remove a directory

Create a symbolic link

Source

fn rename<'life0, 'async_trait>( &'life0 self, uid: u32, gid: u32, param: RenameParam, ) -> Pin<Box<dyn Future<Output = AsyncFusexResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Rename a file

Source

fn open<'life0, 'async_trait>( &'life0 self, uid: u32, gid: u32, ino: u64, flags: u32, ) -> Pin<Box<dyn Future<Output = AsyncFusexResult<u64>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Open a file

Source

fn read<'life0, 'life1, 'async_trait>( &'life0 self, ino: u64, offset: u64, size: u32, buf: &'life1 mut Vec<u8>, ) -> Pin<Box<dyn Future<Output = AsyncFusexResult<usize>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Read data with the given buffer, return current offset and the number of bytes read

Source

fn write<'life0, 'life1, 'async_trait>( &'life0 self, ino: u64, offset: i64, data: &'life1 [u8], flags: u32, ) -> Pin<Box<dyn Future<Output = AsyncFusexResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Write data

Source

fn flush<'life0, 'async_trait>( &'life0 self, ino: u64, lock_owner: u64, ) -> Pin<Box<dyn Future<Output = AsyncFusexResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Flush method

Source

fn release<'life0, 'async_trait>( &'life0 self, ino: u64, flags: u32, lock_owner: u64, flush: bool, ) -> Pin<Box<dyn Future<Output = AsyncFusexResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Release an open file

Source

fn fsync<'life0, 'async_trait>( &'life0 self, ino: u64, datasync: bool, ) -> Pin<Box<dyn Future<Output = AsyncFusexResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Synchronize file contents

Source

fn opendir<'life0, 'async_trait>( &'life0 self, uid: u32, gid: u32, ino: u64, flags: u32, ) -> Pin<Box<dyn Future<Output = AsyncFusexResult<u64>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Open a directory

Source

fn readdir<'life0, 'async_trait>( &'life0 self, uid: u32, gid: u32, ino: u64, fh: u64, offset: i64, ) -> Pin<Box<dyn Future<Output = AsyncFusexResult<Vec<DirEntry>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Read directory

Source

fn releasedir<'life0, 'async_trait>( &'life0 self, ino: u64, fh: u64, flags: u32, ) -> Pin<Box<dyn Future<Output = AsyncFusexResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Release an open directory

Source

fn fsyncdir<'life0, 'async_trait>( &'life0 self, ino: u64, fh: u64, datasync: bool, ) -> Pin<Box<dyn Future<Output = AsyncFusexResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Synchronize directory contents

Source

fn statfs<'life0, 'async_trait>( &'life0 self, uid: u32, gid: u32, ino: u64, ) -> Pin<Box<dyn Future<Output = AsyncFusexResult<StatFsParam>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get file system statistics

Provided Methods§

Source

fn init<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = AsyncFusexResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Initialize filesystem

Source

fn destroy<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = AsyncFusexResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Clean up filesystem

Source

fn interrupt<'life0, 'async_trait>( &'life0 self, unique: u64, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Interrupt another request, especially for FUSE This is a no-op for other filesystems

Create a hard link

Source

fn setxattr<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, ino: u64, name: &'life1 str, value: &'life2 [u8], flags: u32, position: u32, ) -> Pin<Box<dyn Future<Output = AsyncFusexResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Set an extended attribute

Source

fn getxattr<'life0, 'life1, 'async_trait>( &'life0 self, ino: u64, name: &'life1 str, size: u32, ) -> Pin<Box<dyn Future<Output = AsyncFusexResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Get an extended attribute

Source

fn listxattr<'life0, 'async_trait>( &'life0 self, ino: u64, size: u32, ) -> Pin<Box<dyn Future<Output = AsyncFusexResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get an extended attribute

Source

fn removexattr<'life0, 'life1, 'async_trait>( &'life0 self, ino: u64, name: &'life1 str, ) -> Pin<Box<dyn Future<Output = AsyncFusexResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Remove an extended attribute

Source

fn access<'life0, 'async_trait>( &'life0 self, uid: u32, gid: u32, ino: u64, mask: u32, ) -> Pin<Box<dyn Future<Output = AsyncFusexResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Check file access permissions

For FUSE: This will be called for the access() system call. If the default_permissions mount option is given, self method is not called. This method is not called under Linux kernel versions 2.4.x

Source

fn create<'life0, 'life1, 'async_trait>( &'life0 self, uid: u32, gid: u32, ino: u64, parent: u64, name: &'life1 str, mode: u32, flags: u32, ) -> Pin<Box<dyn Future<Output = AsyncFusexResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Create and open a file

For FUSE: If the file does not exist, first create it with the specified mode, and then open it. Open flags (with the exception of O_NOCTTY) are available in flags. Filesystem may store an arbitrary file handle (pointer, index, etc) in fh, and use self in other all other file operations (read, write, flush, release, fsync). There are also some flags (direct_io, keep_cache) which the filesystem may set, to change the way the file is opened. See fuse_file_info structure in fuse_common.h for more details. If self method is not implemented or under Linux kernel versions earlier than 2.6.15, the mknod() and open() methods will be called instead.

Source

fn getlk<'life0, 'async_trait>( &'life0 self, uid: u32, gid: u32, ino: u64, lk_param: FileLockParam, ) -> Pin<Box<dyn Future<Output = AsyncFusexResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Test for a POSIX file lock

Source

fn setlk<'life0, 'async_trait>( &'life0 self, uid: u32, gid: u32, ino: u64, lk_param: FileLockParam, sleep: bool, ) -> Pin<Box<dyn Future<Output = AsyncFusexResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Acquire, modify or release a POSIX file lock

For FUSE: For POSIX threads (NPTL) there’s a 1-1 relation between pid and owner, but otherwise self is not always the case. For checking lock ownership, fi->owner must be used. The l_pid field in struct flock should only be used to fill in self field in getlk(). Note: if the locking methods are not implemented, the kernel will still allow file locking to work locally. Hence these are only interesting for network filesystems and similar.

Source

fn bmap<'life0, 'async_trait>( &'life0 self, uid: u32, gid: u32, ino: u64, blocksize: u32, idx: u64, ) -> Pin<Box<dyn Future<Output = AsyncFusexResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Map block index within file to block index within device Note: This makes sense only for block device backed filesystems mounted with the blkdev option

Implementors§