Struct fuse_backend_rs::transport::FuseSession

source ·
pub struct FuseSession { /* private fields */ }
Expand description

A fuse session manager to manage the connection with the in kernel fuse driver.

Implementations§

source§

impl FuseSession

source

pub fn new( mountpoint: &Path, fsname: &str, subtype: &str, readonly: bool ) -> Result<FuseSession>

Create a new fuse session, without mounting/connecting to the in kernel fuse driver.

source

pub fn new_with_autounmount( mountpoint: &Path, fsname: &str, subtype: &str, readonly: bool, auto_unmount: bool ) -> Result<FuseSession>

Create a new fuse session, without mounting/connecting to the in kernel fuse driver.

source

pub fn set_target_mntns(&mut self, pid: Option<pid_t>)

Set the target pid of mount namespace of the fuse session mount, the fuse will be mounted under the given mnt ns.

source

pub fn set_fusermount(&mut self, bin: &str)

Set fusermount binary, default to fusermount3.

source

pub fn set_allow_other(&mut self, allow_other: bool)

Set the allow_other mount option. This allows other users than the one mounting the filesystem to access the filesystem. However, this option is usually restricted to the root user unless configured otherwise.

source

pub fn get_fusermount(&self) -> &str

Get current fusermount binary.

source

pub fn get_fuse_file(&self) -> Option<&File>

Expose the associated FUSE session file.

source

pub fn set_fuse_file(&mut self, file: File)

Force setting the associated FUSE session file.

source

pub fn mountpoint(&self) -> &Path

Get the mountpoint of the session.

source

pub fn fsname(&self) -> &str

Get the file system name of the session.

source

pub fn subtype(&self) -> &str

Get the subtype of the session.

source

pub fn bufsize(&self) -> usize

Get the default buffer size of the session.

source

pub fn mount(&mut self) -> Result<()>

Mount the fuse mountpoint, building connection with the in kernel fuse driver.

source

pub fn umount(&mut self) -> Result<()>

Destroy a fuse session.

source

pub fn new_channel(&self) -> Result<FuseChannel>

Create a new fuse message channel.

source

pub fn wake(&self) -> Result<()>

Wake channel loop and exit

Trait Implementations§

source§

impl Drop for FuseSession

source§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.