Skip to main content

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: &Config, ) -> Result<Session<FS>>

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

§Errors

Returns an error if the options are incorrect, or if the fuse device can’t be mounted.

Source

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

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

Source

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

Run the session loop in a background thread. If the returned handle is dropped, the filesystem is unmounted and the given session ends.

Source

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

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

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

Auto Trait Implementations§

§

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

§

impl<FS> !RefUnwindSafe for Session<FS>

§

impl<FS> Send for Session<FS>

§

impl<FS> Sync for Session<FS>

§

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

§

impl<FS> !UnwindSafe for Session<FS>

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.