diff --git a/src/mnt/fuse2.rs b/src/mnt/fuse2.rs index 5ce8fe175..ccdf0d819 100644 --- a/src/mnt/fuse2.rs +++ b/src/mnt/fuse2.rs @@ -18,11 +18,17 @@ fn ensure_last_os_error() -> io::Error { } } +/// An active FUSE mount. +/// +/// This struct manages the lifecycle of the mount, unmounting when dropped. #[derive(Debug)] pub struct Mount { mountpoint: CString, } impl Mount { + /// Mounts the filesystem at the given path, with the given options. + /// + /// Returns the mounted FUSE file descriptor along with a [Mount] for handling the mount lifecycle. pub fn new(mountpoint: &Path, options: &[MountOption]) -> io::Result<(Arc, Mount)> { let mountpoint = CString::new(mountpoint.as_os_str().as_bytes()).unwrap(); with_fuse_args(options, |args| { diff --git a/src/mnt/fuse3.rs b/src/mnt/fuse3.rs index b7942b54a..c1ef1f4e8 100644 --- a/src/mnt/fuse3.rs +++ b/src/mnt/fuse3.rs @@ -22,11 +22,17 @@ fn ensure_last_os_error() -> io::Error { } } +/// An active FUSE mount. +/// +/// This struct manages the lifecycle of the mount, unmounting and destroying the session when dropped. #[derive(Debug)] pub struct Mount { fuse_session: *mut c_void, } impl Mount { + /// Mounts the filesystem at the given path, with the given options. + /// + /// Returns the mounted FUSE file descriptor along with a [Mount] for handling the mount lifecycle. pub fn new(mnt: &Path, options: &[MountOption]) -> io::Result<(Arc, Mount)> { let mnt = CString::new(mnt.as_os_str().as_bytes()).unwrap(); with_fuse_args(options, |args| {