pub struct FsBuilder { /* private fields */ }Expand description
Builder for filesystem configuration.
§Examples
Root filesystem only:
VmBuilder::new()
.fs(|fs| fs.root("/path/to/rootfs"));Root filesystem with additional named mounts:
VmBuilder::new()
.fs(|fs| fs.root("/path/to/rootfs"))
.fs(|fs| fs.tag("data").shm_size(1 << 30).path("/host/data"))
.fs(|fs| fs.tag("logs").path("/host/logs"));Custom filesystem backend:
ⓘ
VmBuilder::new()
.fs(|fs| fs.tag("myfs").custom(Box::new(my_backend)));Implementations§
Source§impl FsBuilder
impl FsBuilder
Sourcepub fn root(self, path: impl AsRef<Path>) -> Self
pub fn root(self, path: impl AsRef<Path>) -> Self
Set the root filesystem path.
Uses the virtiofs tag /dev/root, matching the kernel’s expected root device name.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for FsBuilder
impl !UnwindSafe for FsBuilder
impl Freeze for FsBuilder
impl Send for FsBuilder
impl Sync for FsBuilder
impl Unpin for FsBuilder
impl UnsafeUnpin for FsBuilder
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