pub struct Session<FS: Filesystem> { /* private fields */ }
Expand description
The session data structure
Implementations§
source§impl<FS: Filesystem> Session<FS>
impl<FS: Filesystem> Session<FS>
sourcepub fn new(
filesystem: FS,
mountpoint: &Path,
options: &[MountOption]
) -> Result<Session<FS>>
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
sourcepub fn mountpoint(&self) -> &Path
pub fn mountpoint(&self) -> &Path
Return path of the mounted filesystem
sourcepub fn run(&mut self) -> Result<()>
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.
sourcepub fn unmount_callable(&mut self) -> SessionUnmounter
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>
impl<FS: 'static + Filesystem + Send> Session<FS>
sourcepub fn spawn(self) -> Result<BackgroundSession>
pub fn spawn(self) -> Result<BackgroundSession>
Run the session loop in a background thread
Trait Implementations§
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> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more