[−][src]Trait fuse3::Filesystem
Filesystem trait.
Notes:
this trait is defined with async_trait, you can use
async_trait
to implement it, or just implement it directly.
Required methods
#[must_use]fn init<'life0, 'async_trait>(
&'life0 self,
req: Request
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
&'life0 self,
req: Request
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
initialize filesystem. Called before any other filesystem method.
#[must_use]fn destroy<'life0, 'async_trait>(
&'life0 self,
req: Request
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
&'life0 self,
req: Request
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
clean up filesystem. Called on filesystem exit.
#[must_use]fn getlk<'life0, 'async_trait>(
&'life0 self,
_req: Request,
_inode: u64,
_fh: u64,
_lock_owner: u64,
_start: u64,
_end: u64,
_type: u32,
_pid: u32
) -> Pin<Box<dyn Future<Output = Result<ReplyLock>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
&'life0 self,
_req: Request,
_inode: u64,
_fh: u64,
_lock_owner: u64,
_start: u64,
_end: u64,
_type: u32,
_pid: u32
) -> Pin<Box<dyn Future<Output = Result<ReplyLock>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
#[must_use]fn setlk<'life0, 'async_trait>(
&'life0 self,
_req: Request,
_inode: u64,
_fh: u64,
_lock_owner: u64,
_start: u64,
_end: u64,
_type: u32,
_pid: u32,
_block: bool
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
&'life0 self,
_req: Request,
_inode: u64,
_fh: u64,
_lock_owner: u64,
_start: u64,
_end: u64,
_type: u32,
_pid: u32,
_block: bool
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
Provided methods
#[must_use]fn lookup<'life0, 'life1, 'async_trait>(
&'life0 self,
_req: Request,
_parent: u64,
_name: &'life1 OsStr
) -> Pin<Box<dyn Future<Output = Result<ReplyEntry>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: Sync + 'async_trait,
&'life0 self,
_req: Request,
_parent: u64,
_name: &'life1 OsStr
) -> Pin<Box<dyn Future<Output = Result<ReplyEntry>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: Sync + 'async_trait,
look up a directory entry by name and get its attributes.
#[must_use]fn forget<'life0, 'async_trait>(
&'life0 self,
_req: Request,
_inode: u64,
_nlookup: u64
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: Sync + 'async_trait,
&'life0 self,
_req: Request,
_inode: u64,
_nlookup: u64
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: Sync + 'async_trait,
forget an inode. The nlookup parameter indicates the number of lookups previously performed on this inode. If the filesystem implements inode lifetimes, it is recommended that inodes acquire a single reference on each lookup, and lose nlookup references on each forget. The filesystem may ignore forget calls, if the inodes don't need to have a limited lifetime. On unmount it is not guaranteed, that all referenced inodes will receive a forget message.
#[must_use]fn getattr<'life0, 'async_trait>(
&'life0 self,
_req: Request,
_inode: u64,
_fh: Option<u64>,
_flags: u32
) -> Pin<Box<dyn Future<Output = Result<ReplyAttr>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: Sync + 'async_trait,
&'life0 self,
_req: Request,
_inode: u64,
_fh: Option<u64>,
_flags: u32
) -> Pin<Box<dyn Future<Output = Result<ReplyAttr>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: Sync + 'async_trait,
get file attributes. If fh
is None, means fh
is not set.
#[must_use]fn setattr<'life0, 'async_trait>(
&'life0 self,
_req: Request,
_inode: u64,
_fh: Option<u64>,
_set_attr: SetAttr
) -> Pin<Box<dyn Future<Output = Result<ReplyAttr>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: Sync + 'async_trait,
&'life0 self,
_req: Request,
_inode: u64,
_fh: Option<u64>,
_set_attr: SetAttr
) -> Pin<Box<dyn Future<Output = Result<ReplyAttr>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: Sync + 'async_trait,
set file attributes. If fh
is None, means fh
is not set.
#[must_use]fn readlink<'life0, 'async_trait>(
&'life0 self,
_req: Request,
_inode: u64
) -> Pin<Box<dyn Future<Output = Result<ReplyData>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: Sync + 'async_trait,
&'life0 self,
_req: Request,
_inode: u64
) -> Pin<Box<dyn Future<Output = Result<ReplyData>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: Sync + 'async_trait,
read symbolic link.
#[must_use]fn symlink<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_req: Request,
_parent: u64,
_name: &'life1 OsStr,
_link: &'life2 OsStr
) -> Pin<Box<dyn Future<Output = Result<ReplyEntry>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: Sync + 'async_trait,
&'life0 self,
_req: Request,
_parent: u64,
_name: &'life1 OsStr,
_link: &'life2 OsStr
) -> Pin<Box<dyn Future<Output = Result<ReplyEntry>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: Sync + 'async_trait,
create a symbolic link.
#[must_use]fn mknod<'life0, 'life1, 'async_trait>(
&'life0 self,
_req: Request,
_parent: u64,
_name: &'life1 OsStr,
_mode: u32,
_rdev: u32
) -> Pin<Box<dyn Future<Output = Result<ReplyEntry>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: Sync + 'async_trait,
&'life0 self,
_req: Request,
_parent: u64,
_name: &'life1 OsStr,
_mode: u32,
_rdev: u32
) -> Pin<Box<dyn Future<Output = Result<ReplyEntry>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: Sync + 'async_trait,
create file node. Create a regular file, character device, block device, fifo or socket
node. When creating file, most cases user only need to implement create
.
#[must_use]fn mkdir<'life0, 'life1, 'async_trait>(
&'life0 self,
_req: Request,
_parent: u64,
_name: &'life1 OsStr,
_mode: u32,
_umask: u32
) -> Pin<Box<dyn Future<Output = Result<ReplyEntry>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: Sync + 'async_trait,
&'life0 self,
_req: Request,
_parent: u64,
_name: &'life1 OsStr,
_mode: u32,
_umask: u32
) -> Pin<Box<dyn Future<Output = Result<ReplyEntry>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: Sync + 'async_trait,
create a directory.
#[must_use]fn unlink<'life0, 'life1, 'async_trait>(
&'life0 self,
_req: Request,
_parent: u64,
_name: &'life1 OsStr
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: Sync + 'async_trait,
&'life0 self,
_req: Request,
_parent: u64,
_name: &'life1 OsStr
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: Sync + 'async_trait,
remove a file.
#[must_use]fn rmdir<'life0, 'life1, 'async_trait>(
&'life0 self,
_req: Request,
_parent: u64,
_name: &'life1 OsStr
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: Sync + 'async_trait,
&'life0 self,
_req: Request,
_parent: u64,
_name: &'life1 OsStr
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: Sync + 'async_trait,
remove a directory.
#[must_use]fn rename<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_req: Request,
_parent: u64,
_name: &'life1 OsStr,
_new_parent: u64,
_new_name: &'life2 OsStr
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: Sync + 'async_trait,
&'life0 self,
_req: Request,
_parent: u64,
_name: &'life1 OsStr,
_new_parent: u64,
_new_name: &'life2 OsStr
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: Sync + 'async_trait,
rename a file or directory.
#[must_use]fn link<'life0, 'life1, 'async_trait>(
&'life0 self,
_req: Request,
_inode: u64,
_new_parent: u64,
_new_name: &'life1 OsStr
) -> Pin<Box<dyn Future<Output = Result<ReplyEntry>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: Sync + 'async_trait,
&'life0 self,
_req: Request,
_inode: u64,
_new_parent: u64,
_new_name: &'life1 OsStr
) -> Pin<Box<dyn Future<Output = Result<ReplyEntry>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: Sync + 'async_trait,
create a hard link.
#[must_use]fn open<'life0, 'async_trait>(
&'life0 self,
_req: Request,
_inode: u64,
_flags: u32
) -> Pin<Box<dyn Future<Output = Result<ReplyOpen>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: Sync + 'async_trait,
&'life0 self,
_req: Request,
_inode: u64,
_flags: u32
) -> Pin<Box<dyn Future<Output = Result<ReplyOpen>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: Sync + 'async_trait,
open a file. Open flags (with the exception of O_CREAT
, O_EXCL
and O_NOCTTY
) are
available in flags. Filesystem may store an arbitrary file handle (pointer, index, etc) in
fh, and use this in other all other file operations (read, write, flush, release, fsync).
Filesystem may also implement stateless file I/O and not store anything in fh. There are
also some flags (direct_io
, keep_cache
) which the filesystem may set, to change the way
the file is opened.
Notes:
See fuse_file_info
structure in
fuse_common.h for
more details.
#[must_use]fn read<'life0, 'async_trait>(
&'life0 self,
_req: Request,
_inode: u64,
_fh: u64,
_offset: u64,
_size: u32
) -> Pin<Box<dyn Future<Output = Result<ReplyData>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: Sync + 'async_trait,
&'life0 self,
_req: Request,
_inode: u64,
_fh: u64,
_offset: u64,
_size: u32
) -> Pin<Box<dyn Future<Output = Result<ReplyData>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: Sync + 'async_trait,
read data. Read should send exactly the number of bytes requested except on EOF or error,
otherwise the rest of the data will be substituted with zeroes. An exception to this is
when the file has been opened in direct_io
mode, in which case the return value of the
read system call will reflect the return value of this operation. fh
will contain the
value set by the open method, or will be undefined if the open method didn't set any value.
#[must_use]fn write<'life0, 'life1, 'async_trait>(
&'life0 self,
_req: Request,
_inode: u64,
_fh: u64,
_offset: u64,
_data: &'life1 [u8],
_flags: u32
) -> Pin<Box<dyn Future<Output = Result<ReplyWrite>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: Sync + 'async_trait,
&'life0 self,
_req: Request,
_inode: u64,
_fh: u64,
_offset: u64,
_data: &'life1 [u8],
_flags: u32
) -> Pin<Box<dyn Future<Output = Result<ReplyWrite>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: Sync + 'async_trait,
write data. Write should return exactly the number of bytes requested except on error. An
exception to this is when the file has been opened in direct_io
mode, in which case the
return value of the write system call will reflect the return value of this operation. fh
will contain the value set by the open method, or will be undefined if the open method
didn't set any value.
#[must_use]fn statsfs<'life0, 'async_trait>(
&'life0 self,
_req: Request,
_inode: u64
) -> Pin<Box<dyn Future<Output = Result<ReplyStatFs>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: Sync + 'async_trait,
&'life0 self,
_req: Request,
_inode: u64
) -> Pin<Box<dyn Future<Output = Result<ReplyStatFs>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: Sync + 'async_trait,
get filesystem statistics.
#[must_use]fn release<'life0, 'async_trait>(
&'life0 self,
_req: Request,
_inode: u64,
_fh: u64,
_flags: u32,
_lock_owner: u64,
_flush: bool
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: Sync + 'async_trait,
&'life0 self,
_req: Request,
_inode: u64,
_fh: u64,
_flags: u32,
_lock_owner: u64,
_flush: bool
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: Sync + 'async_trait,
release an open file. Release is called when there are no more references to an open file:
all file descriptors are closed and all memory mappings are unmapped. For every open call
there will be exactly one release call. The filesystem may reply with an error, but error
values are not returned to close()
or munmap()
which triggered the release. fh
will
contain the value set by the open method, or will be undefined if the open method didn't
set any value. flags
will contain the same flags as for open. flush
means flush the
data or not when closing file.
#[must_use]fn fsync<'life0, 'async_trait>(
&'life0 self,
_req: Request,
_inode: u64,
_fh: u64,
_datasync: bool
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: Sync + 'async_trait,
&'life0 self,
_req: Request,
_inode: u64,
_fh: u64,
_datasync: bool
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: Sync + 'async_trait,
synchronize file contents. If the datasync
is true, then only the user data should be
flushed, not the metadata.
#[must_use]fn setxattr<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_req: Request,
_inode: u64,
_name: &'life1 OsStr,
_value: &'life2 OsStr,
_flags: u32,
_position: u32
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: Sync + 'async_trait,
&'life0 self,
_req: Request,
_inode: u64,
_name: &'life1 OsStr,
_value: &'life2 OsStr,
_flags: u32,
_position: u32
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: Sync + 'async_trait,
set an extended attribute.
#[must_use]fn getxattr<'life0, 'life1, 'async_trait>(
&'life0 self,
_req: Request,
_inode: u64,
_name: &'life1 OsStr,
_size: u32
) -> Pin<Box<dyn Future<Output = Result<ReplyXAttr>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: Sync + 'async_trait,
&'life0 self,
_req: Request,
_inode: u64,
_name: &'life1 OsStr,
_size: u32
) -> Pin<Box<dyn Future<Output = Result<ReplyXAttr>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: Sync + 'async_trait,
Get an extended attribute. If size is too small, use ReplyXAttr::Size
to return correct
size. If size is enough, use ReplyXAttr::Data
to send it, or return error.
#[must_use]fn listxattr<'life0, 'async_trait>(
&'life0 self,
_req: Request,
_inode: u64,
_size: u32
) -> Pin<Box<dyn Future<Output = Result<ReplyXAttr>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: Sync + 'async_trait,
&'life0 self,
_req: Request,
_inode: u64,
_size: u32
) -> Pin<Box<dyn Future<Output = Result<ReplyXAttr>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: Sync + 'async_trait,
Get an extended attribute. If size is too small, use ReplyXAttr::Size
to return correct
size. If size is enough, use ReplyXAttr::Data
to send it, or return error.
#[must_use]fn removexattr<'life0, 'life1, 'async_trait>(
&'life0 self,
_req: Request,
_inode: u64,
_name: &'life1 OsStr
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: Sync + 'async_trait,
&'life0 self,
_req: Request,
_inode: u64,
_name: &'life1 OsStr
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: Sync + 'async_trait,
remove an extended attribute.
#[must_use]fn flush<'life0, 'async_trait>(
&'life0 self,
_req: Request,
_inode: u64,
_fh: u64,
_lock_owner: u64
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: Sync + 'async_trait,
&'life0 self,
_req: Request,
_inode: u64,
_fh: u64,
_lock_owner: u64
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: Sync + 'async_trait,
flush method. This is called on each close()
of the opened file. Since file descriptors
can be duplicated (dup
, dup2
, fork
), for one open call there may be many flush calls.
Filesystems shouldn't assume that flush will always be called after some writes, or that if
will be called at all. fh
will contain the value set by the open method, or will be
undefined if the open method didn't set any value.
Notes:
the name of the method is misleading, since (unlike fsync) the filesystem is not forced to
flush pending writes. One reason to flush data, is if the filesystem wants to return write
errors. If the filesystem supports file locking operations (setlk
, getlk
) it should
remove all locks belonging to lock_owner
.
#[must_use]fn opendir<'life0, 'async_trait>(
&'life0 self,
_req: Request,
_inode: u64,
_flags: u32
) -> Pin<Box<dyn Future<Output = Result<ReplyOpen>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: Sync + 'async_trait,
&'life0 self,
_req: Request,
_inode: u64,
_flags: u32
) -> Pin<Box<dyn Future<Output = Result<ReplyOpen>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: Sync + 'async_trait,
open a directory. Filesystem may store an arbitrary file handle (pointer, index, etc) in
fh
, and use this in other all other directory stream operations
(readdir
, releasedir
, fsyncdir
). Filesystem may also implement stateless
directory I/O and not store anything in fh
, though that makes it impossible to implement
standard conforming directory stream operations in case the contents of the directory can
change between opendir
and releasedir
.
#[must_use]fn readdir<'life0, 'async_trait>(
&'life0 self,
_req: Request,
_parent: u64,
_fh: u64,
_offset: i64
) -> Pin<Box<dyn Future<Output = Result<ReplyDirectory>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: Sync + 'async_trait,
&'life0 self,
_req: Request,
_parent: u64,
_fh: u64,
_offset: i64
) -> Pin<Box<dyn Future<Output = Result<ReplyDirectory>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: Sync + 'async_trait,
read directory. offset
is used to track the offset of the directory entries. fh
will
contain the value set by the opendir
method, or will be undefined if the opendir
method didn't set any value.
#[must_use]fn releasedir<'life0, 'async_trait>(
&'life0 self,
_req: Request,
_inode: u64,
_fh: u64,
_flags: u32
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: Sync + 'async_trait,
&'life0 self,
_req: Request,
_inode: u64,
_fh: u64,
_flags: u32
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: Sync + 'async_trait,
release an open directory. For every opendir
call there will be exactly one
releasedir
call. fh
will contain the value set by the opendir
method, or will be
undefined if the opendir
method didn't set any value.
#[must_use]fn fsyncdir<'life0, 'async_trait>(
&'life0 self,
_req: Request,
_inode: u64,
_fh: u64,
_datasync: bool
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: Sync + 'async_trait,
&'life0 self,
_req: Request,
_inode: u64,
_fh: u64,
_datasync: bool
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: Sync + 'async_trait,
synchronize directory contents. If the datasync
is true, then only the directory contents
should be flushed, not the metadata. fh
will contain the value set by the opendir
method, or will be undefined if the opendir
method didn't set any value.
#[must_use]fn access<'life0, 'async_trait>(
&'life0 self,
_req: Request,
_inode: u64,
_mask: u32
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: Sync + 'async_trait,
&'life0 self,
_req: Request,
_inode: u64,
_mask: u32
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: Sync + 'async_trait,
check file access permissions. This will be called for the access()
system call. If the
default_permissions
mount option is given, this method is not be called. This method is
not called under Linux kernel versions 2.4.x.
#[must_use]fn create<'life0, 'life1, 'async_trait>(
&'life0 self,
_req: Request,
_parent: u64,
_name: &'life1 OsStr,
_mode: u32,
_flags: u32
) -> Pin<Box<dyn Future<Output = Result<ReplyCreated>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: Sync + 'async_trait,
&'life0 self,
_req: Request,
_parent: u64,
_name: &'life1 OsStr,
_mode: u32,
_flags: u32
) -> Pin<Box<dyn Future<Output = Result<ReplyCreated>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: Sync + 'async_trait,
create and open a file. 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
this 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. If this method is not implemented or under Linux kernel versions earlier than
2.6.15, the mknod
and open
methods will be called instead.
Notes:
See fuse_file_info
structure in
fuse_common.h for
more details.
#[must_use]fn interrupt<'life0, 'async_trait>(
&'life0 self,
_req: Request,
_unique: u64
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: Sync + 'async_trait,
&'life0 self,
_req: Request,
_unique: u64
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: Sync + 'async_trait,
handle interrupt. When a operation is interrupted, an interrupt request will send to fuse server with the unique id of the operation.
#[must_use]fn bmap<'life0, 'async_trait>(
&'life0 self,
_req: Request,
_inode: u64,
_blocksize: u32,
_idx: u64
) -> Pin<Box<dyn Future<Output = Result<ReplyBmap>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: Sync + 'async_trait,
&'life0 self,
_req: Request,
_inode: u64,
_blocksize: u32,
_idx: u64
) -> Pin<Box<dyn Future<Output = Result<ReplyBmap>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: Sync + 'async_trait,
map block index within file to block index within device.
Notes:
This may not works because currently this crate doesn't support fuseblk mode.
#[must_use]fn poll<'life0, 'async_trait>(
&'life0 self,
_req: Request,
_inode: u64,
_fh: u64,
_kh: Option<u64>,
_flags: u32,
_events: u32
) -> Pin<Box<dyn Future<Output = Result<ReplyPoll>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: Sync + 'async_trait,
&'life0 self,
_req: Request,
_inode: u64,
_fh: u64,
_kh: Option<u64>,
_flags: u32,
_events: u32
) -> Pin<Box<dyn Future<Output = Result<ReplyPoll>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: Sync + 'async_trait,
poll for IO readiness events.
#[must_use]fn notify_reply<'life0, 'async_trait>(
&'life0 self,
_req: Request,
_inode: u64,
_offset: u64,
_data: Vec<u8>
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: Sync + 'async_trait,
&'life0 self,
_req: Request,
_inode: u64,
_offset: u64,
_data: Vec<u8>
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: Sync + 'async_trait,
receive notify reply from kernel.
#[must_use]fn batch_forget<'life0, 'life1, 'async_trait>(
&'life0 self,
_req: Request,
_inodes: &'life1 [u64]
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: Sync + 'async_trait,
&'life0 self,
_req: Request,
_inodes: &'life1 [u64]
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: Sync + 'async_trait,
forget more than one inode. This is a batch version forget
#[must_use]fn fallocate<'life0, 'async_trait>(
&'life0 self,
_req: Request,
_inode: u64,
_fh: u64,
_offset: u64,
_length: u64,
_mode: u32
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: Sync + 'async_trait,
&'life0 self,
_req: Request,
_inode: u64,
_fh: u64,
_offset: u64,
_length: u64,
_mode: u32
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: Sync + 'async_trait,
allocate space for an open file. This function ensures that required space is allocated for specified file.
Notes:
more infomation about fallocate
, please see man 2 fallocate
#[must_use]fn readdirplus<'life0, 'async_trait>(
&'life0 self,
_req: Request,
_parent: u64,
_fh: u64,
_offset: u64,
_lock_owner: u64
) -> Pin<Box<dyn Future<Output = Result<ReplyDirectoryPlus>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: Sync + 'async_trait,
&'life0 self,
_req: Request,
_parent: u64,
_fh: u64,
_offset: u64,
_lock_owner: u64
) -> Pin<Box<dyn Future<Output = Result<ReplyDirectoryPlus>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: Sync + 'async_trait,
#[must_use]fn rename2<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_req: Request,
_parent: u64,
_name: &'life1 OsStr,
_new_parent: u64,
_new_name: &'life2 OsStr,
_flags: u32
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: Sync + 'async_trait,
&'life0 self,
_req: Request,
_parent: u64,
_name: &'life1 OsStr,
_new_parent: u64,
_new_name: &'life2 OsStr,
_flags: u32
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: Sync + 'async_trait,
rename a file or directory with flags.
#[must_use]fn lseek<'life0, 'async_trait>(
&'life0 self,
_req: Request,
_inode: u64,
_fh: u64,
_offset: u64,
_whence: u32
) -> Pin<Box<dyn Future<Output = Result<ReplyLSeek>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: Sync + 'async_trait,
&'life0 self,
_req: Request,
_inode: u64,
_fh: u64,
_offset: u64,
_whence: u32
) -> Pin<Box<dyn Future<Output = Result<ReplyLSeek>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: Sync + 'async_trait,
find next data or hole after the specified offset.
#[must_use]fn copy_file_range<'life0, 'async_trait>(
&'life0 self,
_req: Request,
_inode: u64,
_fh_in: u64,
_off_in: u64,
_inode_out: u64,
_fh_out: u64,
_off_out: u64,
_length: u64,
_flags: u64
) -> Pin<Box<dyn Future<Output = Result<ReplyCopyFileRange>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: Sync + 'async_trait,
&'life0 self,
_req: Request,
_inode: u64,
_fh_in: u64,
_off_in: u64,
_inode_out: u64,
_fh_out: u64,
_off_out: u64,
_length: u64,
_flags: u64
) -> Pin<Box<dyn Future<Output = Result<ReplyCopyFileRange>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: Sync + 'async_trait,
copy a range of data from one file to another. This can improve performance because it reduce data copy: in normal, data will copy from FUSE server to kernel, then to user-space, then to kernel, finally send back to FUSE server. By implement this method, data will only copy in FUSE server internal.