Session

Struct Session 

Source
pub struct Session<FS: Filesystem> { /* private fields */ }
Expand description

The session data structure

Implementations§

Source§

impl<FS: Filesystem> Session<FS>

Source

pub fn new<P: AsRef<Path>>( filesystem: FS, mountpoint: P, options: &[MountOption], ) -> Result<Session<FS>>

Create a new session by mounting the given filesystem to the given mountpoint

Source

pub fn from_fd(filesystem: FS, fd: OwnedFd, acl: SessionACL) -> Self

Wrap an existing /dev/fuse file descriptor. This doesn’t mount the filesystem anywhere; that must be done separately.

Source

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

Run the session loop that receives kernel requests and dispatches them to method calls into the filesystem.

Source

pub fn run_with_callbacks<FA, FB>( &self, before_dispatch: FB, after_dispatch: FA, clone_fuse_fd: bool, ) -> Result<()>
where FB: FnMut(&Request<'_>), FA: FnMut(&Request<'_>),

Run the session loop that receives kernel requests and dispatches them to method calls into the filesystem. This version also notifies callers of kernel requests before and after they are dispatched to the filesystem.

Source

pub fn unmount(&mut self)

Unmount the filesystem

Source

pub fn unmount_callable(&mut self) -> SessionUnmounter

Returns a thread-safe object that can be used to unmount the Filesystem

Source

pub fn notifier(&self) -> Notifier

Returns an object that can be used to send notifications to the kernel

Source§

impl<FS: 'static + Filesystem + Send> Session<FS>

Source

pub fn spawn(self) -> Result<BackgroundSession>

Run the session loop in a background thread

Trait Implementations§

Source§

impl<FS: Filesystem> AsFd for Session<FS>

Source§

fn as_fd(&self) -> BorrowedFd<'_>

Borrows the file descriptor. Read more
Source§

impl<FS: Debug + Filesystem> Debug for Session<FS>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<FS: Filesystem> Drop for Session<FS>

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

§

impl<FS> !Freeze for Session<FS>

§

impl<FS> RefUnwindSafe for Session<FS>
where FS: RefUnwindSafe,

§

impl<FS> Send for Session<FS>
where FS: Send,

§

impl<FS> Sync for Session<FS>
where FS: Sync,

§

impl<FS> Unpin for Session<FS>
where FS: Unpin,

§

impl<FS> UnwindSafe for Session<FS>
where FS: UnwindSafe,

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>,

Source§

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>,

Source§

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.