[go: up one dir, main page]

Struct Session

Source
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: FS

Filesystem operation implementations

§proto_major: u32

FUSE protocol major version

§proto_minor: u32

FUSE protocol minor version

§initialized: bool

True if the filesystem is initialized (init operation done)

§destroyed: bool

True if the filesystem was destroyed (destroy operation done)

Implementations§

Source§

impl<FS: Filesystem> Session<FS>

Source

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

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§

impl<'a, FS: Filesystem + Send + 'a> Session<FS>

Source

pub unsafe fn spawn(self) -> Result<BackgroundSession<'a>>

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