Skip to content

Commit

Permalink
Add missing documentation for fuser Mount structs (#1105)
Browse files Browse the repository at this point in the history
Our fuser fork emits a lot of warnings during builds, impacting our pull
requests. This change addresses missing documentation on one struct in
fuser (which was introduced by our change in
#1098).

This change is a good candidate to be contributed to upstream. Once
contributed, this commit can be removed.

Relevant issues: N/A

No.

---

By submitting this pull request, I confirm that my contribution is made
under the terms of the Apache 2.0 license and I agree to the terms of
the [Developer Certificate of Origin
(DCO)](https://developercertificate.org/).

---------

Signed-off-by: Daniel Carl Jones <[email protected]>
  • Loading branch information
dannycjones committed Nov 12, 2024
1 parent b91987f commit daad567
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/mnt/fuse2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<File>, Mount)> {
let mountpoint = CString::new(mountpoint.as_os_str().as_bytes()).unwrap();
with_fuse_args(options, |args| {
Expand Down
6 changes: 6 additions & 0 deletions src/mnt/fuse3.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<File>, Mount)> {
let mnt = CString::new(mnt.as_os_str().as_bytes()).unwrap();
with_fuse_args(options, |args| {
Expand Down

0 comments on commit daad567

Please sign in to comment.