pub struct Session<FS: Filesystem> { /* private fields */ }Expand description
The session data structure
Implementations§
Source§impl<FS: Filesystem> Session<FS>
impl<FS: Filesystem> Session<FS>
Sourcepub fn new<P: AsRef<Path>>(
filesystem: FS,
mountpoint: P,
options: &Config,
) -> Result<Session<FS>>
pub fn new<P: AsRef<Path>>( filesystem: FS, mountpoint: P, options: &Config, ) -> Result<Session<FS>>
Create a new session by mounting the given filesystem to the given mountpoint
§Errors
Returns an error if the options are incorrect, or if the fuse device can’t be mounted.
Sourcepub fn from_fd(
filesystem: FS,
fd: OwnedFd,
acl: SessionACL,
config: Config,
) -> Result<Self>
pub fn from_fd( filesystem: FS, fd: OwnedFd, acl: SessionACL, config: Config, ) -> Result<Self>
Wrap an existing /dev/fuse file descriptor. This doesn’t mount the filesystem anywhere; that must be done separately.
Sourcepub fn spawn(self) -> Result<BackgroundSession>
pub fn spawn(self) -> Result<BackgroundSession>
Run the session loop in a background thread. If the returned handle is dropped, the filesystem is unmounted and the given session ends.
Sourcepub fn run(self) -> Result<()>
pub fn run(self) -> Result<()>
Run the session loop that receives kernel requests and dispatches them to method calls into the filesystem. This read-dispatch-loop is non-concurrent to prevent having multiple buffers (which take up much memory), but the filesystem methods may run concurrent by spawning threads.
§Errors
Returns any final error when the session comes to an end.
Sourcepub fn unmount_callable(&mut self) -> SessionUnmounter
pub fn unmount_callable(&mut self) -> SessionUnmounter
Returns a thread-safe object that can be used to unmount the Filesystem