Skip to content

Commit

Permalink
Merge branch 'fuser/fork' into fuser/add-cfg-for-mount-impl
Browse files Browse the repository at this point in the history
  • Loading branch information
dannycjones committed Nov 6, 2024
2 parents b7244b1 + 06212fc commit ced6735
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 ced6735

Please sign in to comment.