Skip to main content

Crate fuser_ng

Crate fuser_ng 

Source
Expand description

FuserNG – A higher-level FUSE (Filesystem in Userspace) interface and wrapper around the low-level fuser library that makes implementing a filesystem a bit easier.

FuserNG translates inodes to paths and simplifies some details of filesystem implementation, for example: splitting the setattr call into multiple separate operations, and simplifying the readdir call so that filesystems don’t need to deal with pagination.

To implement a filesystem, implement the Filesystem trait. Not all functions in it need to be implemented – the default behavior is to return ENOSYS (“Function not implemented”). For example, a read-only filesystem can skip implementing the write call and many others.

Structs§

CallbackResult
Dummy struct returned by the callback in the read() method. Cannot be constructed outside this crate, read() requires you to return it, thus ensuring that you don’t forget to call the callback.
CreatedEntry
The return value for create: contains info on the newly-created file, as well as a handle to the opened file.
DirectoryEntry
A directory entry.
EntryName
Entry name resolved relative to a parent directory path.
FileAttr
File attributes.
FolderPath
Shared path for a directory entry in the inode table.
FuserNG
Path-oriented wrapper around a user filesystem implementation.
KernelConfig
Configuration of the fuse kernel module connection
RequestInfo
Info about a request.
ResolvedPath
Path resolved from an inode with the current inode number attached.
Statfs
Filesystem statistics.

Enums§

FileType
File types
MountOption
Mount options accepted by the FUSE filesystem type See ‘man mount.fuse’ for details
ThreadCount
Number of fuser event-loop threads used to serve a mount. This configures fuser session threading, not an internal worker pool.
Xattr
Represents the return value from the listxattr and getxattr calls, which can be either a size or contain data, depending on how they are called.

Constants§

VERSION
Crate version from Cargo package metadata.

Traits§

Filesystem
This trait must be implemented to implement a filesystem with FuserNG.

Functions§

mount
Mount the given filesystem to the given mountpoint. This function will not return until the filesystem is unmounted.
spawn_mount
Mount the given filesystem to the given mountpoint. This function spawns a background thread to handle filesystem operations while being mounted and therefore returns immediately. The returned handle should be stored to reference the mounted filesystem. If it’s dropped, the filesystem will be unmounted.

Type Aliases§

Inode
ResultCreate
ResultData
ResultEmpty
ResultEntry
ResultGetattrDeprecated
ResultOpen
ResultReaddir
ResultSlice
ResultStatfs
ResultWrite
ResultXattr