Struct fuser::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( filesystem: FS, mountpoint: &Path, options: &[MountOption] ) -> Result<Session<FS>>

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

source

pub fn mountpoint(&self) -> &Path

Return path of the mounted filesystem

source

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

Run the session loop that receives kernel requests and dispatches them to method calls into the filesystem. This read-dispatch-loop is non-concurrent to prevent having multiple buffers (which take up much memory), but the filesystem methods may run concurrent by spawning threads.

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§

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: 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> 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 Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere 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 Twhere 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 Twhere 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 Twhere 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.