pub struct Session<FS: Filesystem> {
pub filesystem: FS,
pub proto_major: u32,
pub proto_minor: u32,
pub initialized: bool,
pub destroyed: bool,
/* private fields */
}Expand description
The session data structure
Fields§
§filesystem: FSFilesystem operation implementations
proto_major: u32FUSE protocol major version
proto_minor: u32FUSE protocol minor version
initialized: boolTrue if the filesystem is initialized (init operation done)
destroyed: boolTrue if the filesystem was destroyed (destroy operation done)
Implementations§
Source§impl<FS: Filesystem> Session<FS>
impl<FS: Filesystem> Session<FS>
Sourcepub fn new(
filesystem: FS,
mountpoint: &Path,
options: &[&OsStr],
) -> Result<Session<FS>>
pub fn new( filesystem: FS, mountpoint: &Path, options: &[&OsStr], ) -> 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.
Source§impl<'a, FS: Filesystem + Send + 'a> Session<FS>
impl<'a, FS: Filesystem + Send + 'a> Session<FS>
Sourcepub unsafe fn spawn(self) -> Result<BackgroundSession<'a>>
pub unsafe fn spawn(self) -> Result<BackgroundSession<'a>>
Run the session loop in a background thread
Trait Implementations§
Auto Trait Implementations§
impl<FS> Freeze for Session<FS>where
FS: Freeze,
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