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 set_dax_mapper(&mut self, mapper: Arc<dyn DaxMapper>)
pub fn set_dax_mapper(&mut self, mapper: Arc<dyn DaxMapper>)
Sets the DAX mapper for direct host page mapping.
Must be called after start().
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 !RefUnwindSafe for FsServer
impl !UnwindSafe for FsServer
impl Freeze for FsServer
impl Send for FsServer
impl Sync for FsServer
impl Unpin for FsServer
impl UnsafeUnpin 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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more