From 29eb5866b03212a05bb520374827b7e81d302030 Mon Sep 17 00:00:00 2001 From: Daniel Carl Jones Date: Wed, 6 Nov 2024 17:06:41 +0000 Subject: [PATCH 1/2] Add missing documentation for mnt::fuse2::Mount Signed-off-by: Daniel Carl Jones --- src/mnt/fuse2.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/mnt/fuse2.rs b/src/mnt/fuse2.rs index 6f3e391e3..8d6c2907d 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| { From 37875231c202f24668d7601a87ea011e82d34854 Mon Sep 17 00:00:00 2001 From: Daniel Carl Jones Date: Wed, 6 Nov 2024 17:20:19 +0000 Subject: [PATCH 2/2] Add missing documentation for mnt::fuse3::Mount Signed-off-by: Daniel Carl Jones --- src/mnt/fuse3.rs | 6 ++++++ 1 file changed, 6 insertions(+) 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| {