pub struct FsServer { /* private fields */ }Expand description
Filesystem server.
Manages the virtiofs server lifecycle and request handling.
Integrates PassthroughFs for host filesystem access and
FuseDispatcher for FUSE protocol handling.
Implementations§
Source§impl FsServer
impl FsServer
Sourcepub const fn state(&self) -> ServerState
pub const fn state(&self) -> ServerState
Returns the current server state.
Sourcepub fn start(&mut self) -> Result<()>
pub fn start(&mut self) -> Result<()>
Starts the server.
Initializes the passthrough filesystem and FUSE dispatcher.
§Errors
Returns an error if the filesystem cannot be initialized.
Sourcepub fn handle_request(&self, request: &[u8]) -> Result<Vec<u8>>
pub fn handle_request(&self, request: &[u8]) -> Result<Vec<u8>>
Handles a FUSE request and returns the response.
This method is called by the virtio-fs device when it receives a request from the guest.
§Errors
Returns an error if the request cannot be processed.
Sourcepub fn filesystem(&self) -> Option<&Arc<PassthroughFs>>
pub fn filesystem(&self) -> Option<&Arc<PassthroughFs>>
Returns a reference to the passthrough filesystem.
Sourcepub fn dispatcher(&self) -> Option<&FuseDispatcher>
pub fn dispatcher(&self) -> Option<&FuseDispatcher>
Returns a reference to the dispatcher.
Trait Implementations§
Source§impl FuseRequestHandler for FsServer
impl FuseRequestHandler for FsServer
Auto Trait Implementations§
impl !Freeze for FsServer
impl !RefUnwindSafe for FsServer
impl Send for FsServer
impl Sync for FsServer
impl Unpin for FsServer
impl UnsafeUnpin for FsServer
impl !UnwindSafe for FsServer
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