Struct encrypted_fs::encrypted_fs_fuse3::EncryptedFsFuse3
source · pub struct EncryptedFsFuse3 { /* private fields */ }
Implementations§
Trait Implementations§
source§impl Filesystem for EncryptedFsFuse3
impl Filesystem for EncryptedFsFuse3
source§async fn init(&self, _req: Request) -> Result<ReplyInit>
async fn init(&self, _req: Request) -> Result<ReplyInit>
initialize filesystem. Called before any other filesystem method.
source§async fn destroy(&self, _req: Request)
async fn destroy(&self, _req: Request)
clean up filesystem. Called on filesystem exit which is fuseblk, in normal fuse filesystem,
kernel may call forget for root. There is some discuss for this
https://github.com/bazil/fuse/issues/82#issuecomment-88126886,
https://sourceforge.net/p/fuse/mailman/message/31995737/
source§async fn lookup(
&self,
req: Request,
parent: u64,
name: &OsStr
) -> Result<ReplyEntry>
async fn lookup( &self, req: Request, parent: u64, name: &OsStr ) -> Result<ReplyEntry>
look up a directory entry by name and get its attributes.
source§async fn forget(&self, req: Request, inode: Inode, nlookup: u64)
async fn forget(&self, req: Request, inode: Inode, nlookup: u64)
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. When filesystem is normal(not fuseblk) and unmounting, kernel may send forget
request for root and this library will stop session after call forget. There is some
discussion for this https://github.com/bazil/fuse/issues/82#issuecomment-88126886,
https://sourceforge.net/p/fuse/mailman/message/31995737/
source§async fn getattr(
&self,
_req: Request,
inode: u64,
_fh: Option<u64>,
_flags: u32
) -> Result<ReplyAttr>
async fn getattr( &self, _req: Request, inode: u64, _fh: Option<u64>, _flags: u32 ) -> Result<ReplyAttr>
get file attributes. If
fh
is None, means fh
is not set.source§async fn setattr(
&self,
req: Request,
inode: Inode,
fh: Option<u64>,
set_attr: SetAttr
) -> Result<ReplyAttr>
async fn setattr( &self, req: Request, inode: Inode, fh: Option<u64>, set_attr: SetAttr ) -> Result<ReplyAttr>
set file attributes. If
fh
is None, means fh
is not set.source§async fn mknod(
&self,
req: Request,
parent: Inode,
name: &OsStr,
mode: u32,
rdev: u32
) -> Result<ReplyEntry>
async fn mknod( &self, req: Request, parent: Inode, name: &OsStr, mode: u32, rdev: u32 ) -> Result<ReplyEntry>
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
.source§async fn mkdir(
&self,
req: Request,
parent: Inode,
name: &OsStr,
mode: u32,
umask: u32
) -> Result<ReplyEntry>
async fn mkdir( &self, req: Request, parent: Inode, name: &OsStr, mode: u32, umask: u32 ) -> Result<ReplyEntry>
create a directory.
source§async fn unlink(&self, req: Request, parent: Inode, name: &OsStr) -> Result<()>
async fn unlink(&self, req: Request, parent: Inode, name: &OsStr) -> Result<()>
remove a file.
source§async fn rmdir(&self, req: Request, parent: Inode, name: &OsStr) -> Result<()>
async fn rmdir(&self, req: Request, parent: Inode, name: &OsStr) -> Result<()>
remove a directory.
source§async fn rename(
&self,
req: Request,
parent: Inode,
name: &OsStr,
new_parent: Inode,
new_name: &OsStr
) -> Result<()>
async fn rename( &self, req: Request, parent: Inode, name: &OsStr, new_parent: Inode, new_name: &OsStr ) -> Result<()>
rename a file or directory.
source§async fn open(
&self,
req: Request,
inode: Inode,
flags: u32
) -> Result<ReplyOpen>
async fn open( &self, req: Request, inode: Inode, flags: u32 ) -> Result<ReplyOpen>
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. A filesystem need not implement this method if it
sets MountOptions::no_open_support
and if the
kernel supports FUSE_NO_OPEN_SUPPORT
. Read moresource§async fn read(
&self,
_req: Request,
inode: u64,
fh: u64,
offset: u64,
size: u32
) -> Result<ReplyData>
async fn read( &self, _req: Request, inode: u64, fh: u64, offset: u64, size: u32 ) -> Result<ReplyData>
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.source§async fn write(
&self,
_req: Request,
inode: Inode,
fh: u64,
offset: u64,
data: &[u8],
_write_flags: u32,
_flags: u32
) -> Result<ReplyWrite>
async fn write( &self, _req: Request, inode: Inode, fh: u64, offset: u64, data: &[u8], _write_flags: u32, _flags: u32 ) -> Result<ReplyWrite>
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. When write_flags
contains
FUSE_WRITE_CACHE
, means the write operation is a
delay write.source§async fn statfs(&self, _req: Request, inode: u64) -> Result<ReplyStatFs>
async fn statfs(&self, _req: Request, inode: u64) -> Result<ReplyStatFs>
get filesystem statistics.
source§async fn release(
&self,
req: Request,
inode: Inode,
fh: u64,
flags: u32,
lock_owner: u64,
flush: bool
) -> Result<()>
async fn release( &self, req: Request, inode: Inode, fh: u64, flags: u32, lock_owner: u64, flush: bool ) -> Result<()>
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.source§async fn flush(
&self,
req: Request,
inode: Inode,
fh: u64,
lock_owner: u64
) -> Result<()>
async fn flush( &self, req: Request, inode: Inode, fh: u64, lock_owner: u64 ) -> Result<()>
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. Read moresource§async fn opendir(
&self,
req: Request,
inode: Inode,
flags: u32
) -> Result<ReplyOpen>
async fn opendir( &self, req: Request, inode: Inode, flags: u32 ) -> Result<ReplyOpen>
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
. A file system need not implement this method if it
sets MountOptions::no_open_dir_support
and
if the kernel supports FUSE_NO_OPENDIR_SUPPORT
.§type DirEntryStream<'a> = Iter<Skip<DirectoryEntryIterator>>
where
Self: 'a
type DirEntryStream<'a> = Iter<Skip<DirectoryEntryIterator>> where Self: 'a
dir entry stream given by
readdir
.source§async fn readdir(
&self,
_req: Request,
inode: u64,
fh: u64,
offset: i64
) -> Result<ReplyDirectory<Self::DirEntryStream<'_>>>
async fn readdir( &self, _req: Request, inode: u64, fh: u64, offset: i64 ) -> Result<ReplyDirectory<Self::DirEntryStream<'_>>>
source§async fn access(&self, req: Request, inode: u64, mask: u32) -> Result<()>
async fn access(&self, req: Request, inode: u64, mask: u32) -> Result<()>
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.source§async fn create(
&self,
req: Request,
parent: Inode,
name: &OsStr,
mode: u32,
flags: u32
) -> Result<ReplyCreated>
async fn create( &self, req: Request, parent: Inode, name: &OsStr, mode: u32, flags: u32 ) -> Result<ReplyCreated>
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. Read more§type DirEntryPlusStream<'a> = Iter<Skip<DirectoryEntryPlusIterator>>
where
Self: 'a
type DirEntryPlusStream<'a> = Iter<Skip<DirectoryEntryPlusIterator>> where Self: 'a
dir entry plus stream given by
readdirplus
.source§async fn readdirplus(
&self,
_req: Request,
parent: u64,
_fh: u64,
offset: u64,
_lock_owner: u64
) -> Result<ReplyDirectoryPlus<Self::DirEntryPlusStream<'_>>>
async fn readdirplus( &self, _req: Request, parent: u64, _fh: u64, offset: u64, _lock_owner: u64 ) -> Result<ReplyDirectoryPlus<Self::DirEntryPlusStream<'_>>>
source§async fn copy_file_range(
&self,
req: Request,
inode: Inode,
fh_in: u64,
off_in: u64,
inode_out: Inode,
fh_out: u64,
off_out: u64,
length: u64,
flags: u64
) -> Result<ReplyCopyFileRange>
async fn copy_file_range( &self, req: Request, inode: Inode, fh_in: u64, off_in: u64, inode_out: Inode, fh_out: u64, off_out: u64, length: u64, flags: u64 ) -> Result<ReplyCopyFileRange>
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.
source§fn readlink(
&self,
req: Request,
inode: u64
) -> impl Future<Output = Result<ReplyData, Errno>> + Send
fn readlink( &self, req: Request, inode: u64 ) -> impl Future<Output = Result<ReplyData, Errno>> + Send
read symbolic link.
source§fn symlink(
&self,
req: Request,
parent: u64,
name: &OsStr,
link: &OsStr
) -> impl Future<Output = Result<ReplyEntry, Errno>> + Send
fn symlink( &self, req: Request, parent: u64, name: &OsStr, link: &OsStr ) -> impl Future<Output = Result<ReplyEntry, Errno>> + Send
create a symbolic link.
source§fn link(
&self,
req: Request,
inode: u64,
new_parent: u64,
new_name: &OsStr
) -> impl Future<Output = Result<ReplyEntry, Errno>> + Send
fn link( &self, req: Request, inode: u64, new_parent: u64, new_name: &OsStr ) -> impl Future<Output = Result<ReplyEntry, Errno>> + Send
create a hard link.
source§fn fsync(
&self,
req: Request,
inode: u64,
fh: u64,
datasync: bool
) -> impl Future<Output = Result<(), Errno>> + Send
fn fsync( &self, req: Request, inode: u64, fh: u64, datasync: bool ) -> impl Future<Output = Result<(), Errno>> + Send
synchronize file contents. If the
datasync
is true, then only the user data should be
flushed, not the metadata.source§fn setxattr(
&self,
req: Request,
inode: u64,
name: &OsStr,
value: &[u8],
flags: u32,
position: u32
) -> impl Future<Output = Result<(), Errno>> + Send
fn setxattr( &self, req: Request, inode: u64, name: &OsStr, value: &[u8], flags: u32, position: u32 ) -> impl Future<Output = Result<(), Errno>> + Send
set an extended attribute.
source§fn getxattr(
&self,
req: Request,
inode: u64,
name: &OsStr,
size: u32
) -> impl Future<Output = Result<ReplyXAttr, Errno>> + Send
fn getxattr( &self, req: Request, inode: u64, name: &OsStr, size: u32 ) -> impl Future<Output = Result<ReplyXAttr, Errno>> + Send
Get an extended attribute. If
size
is too small, return Err<ERANGE>
.
Otherwise, use ReplyXAttr::Data
to send the attribute data, or
return an error.source§fn listxattr(
&self,
req: Request,
inode: u64,
size: u32
) -> impl Future<Output = Result<ReplyXAttr, Errno>> + Send
fn listxattr( &self, req: Request, inode: u64, size: u32 ) -> impl Future<Output = Result<ReplyXAttr, Errno>> + Send
List extended attribute names. Read more
source§fn removexattr(
&self,
req: Request,
inode: u64,
name: &OsStr
) -> impl Future<Output = Result<(), Errno>> + Send
fn removexattr( &self, req: Request, inode: u64, name: &OsStr ) -> impl Future<Output = Result<(), Errno>> + Send
remove an extended attribute.
source§fn fsyncdir(
&self,
req: Request,
inode: u64,
fh: u64,
datasync: bool
) -> impl Future<Output = Result<(), Errno>> + Send
fn fsyncdir( &self, req: Request, inode: u64, fh: u64, datasync: bool ) -> impl Future<Output = Result<(), Errno>> + Send
source§fn interrupt(
&self,
req: Request,
unique: u64
) -> impl Future<Output = Result<(), Errno>> + Send
fn interrupt( &self, req: Request, unique: u64 ) -> impl Future<Output = Result<(), Errno>> + Send
handle interrupt. When a operation is interrupted, an interrupt request will send to fuse
server with the unique id of the operation.
source§fn bmap(
&self,
req: Request,
inode: u64,
blocksize: u32,
idx: u64
) -> impl Future<Output = Result<ReplyBmap, Errno>> + Send
fn bmap( &self, req: Request, inode: u64, blocksize: u32, idx: u64 ) -> impl Future<Output = Result<ReplyBmap, Errno>> + Send
map block index within file to block index within device. Read more
source§fn poll(
&self,
req: Request,
inode: u64,
fh: u64,
kh: Option<u64>,
flags: u32,
events: u32,
notify: &Notify
) -> impl Future<Output = Result<ReplyPoll, Errno>> + Send
fn poll( &self, req: Request, inode: u64, fh: u64, kh: Option<u64>, flags: u32, events: u32, notify: &Notify ) -> impl Future<Output = Result<ReplyPoll, Errno>> + Send
poll for IO readiness events.
source§fn notify_reply(
&self,
req: Request,
inode: u64,
offset: u64,
data: Bytes
) -> impl Future<Output = Result<(), Errno>> + Send
fn notify_reply( &self, req: Request, inode: u64, offset: u64, data: Bytes ) -> impl Future<Output = Result<(), Errno>> + Send
receive notify reply from kernel.
source§fn batch_forget(
&self,
req: Request,
inodes: &[u64]
) -> impl Future<Output = ()> + Send
fn batch_forget( &self, req: Request, inodes: &[u64] ) -> impl Future<Output = ()> + Send
forget more than one inode. This is a batch version
forget
source§fn fallocate(
&self,
req: Request,
inode: u64,
fh: u64,
offset: u64,
length: u64,
mode: u32
) -> impl Future<Output = Result<(), Errno>> + Send
fn fallocate( &self, req: Request, inode: u64, fh: u64, offset: u64, length: u64, mode: u32 ) -> impl Future<Output = Result<(), Errno>> + Send
allocate space for an open file. This function ensures that required space is allocated for
specified file. Read more
Auto Trait Implementations§
impl !Freeze for EncryptedFsFuse3
impl !RefUnwindSafe for EncryptedFsFuse3
impl Send for EncryptedFsFuse3
impl Sync for EncryptedFsFuse3
impl Unpin for EncryptedFsFuse3
impl UnwindSafe for EncryptedFsFuse3
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more