pub struct MountableFs { /* private fields */ }Expand description
A composite filesystem that delegates to mounted backends via longest-prefix matching.
§Example
ⓘ
use rust_bash::{RustBashBuilder, InMemoryFs, MountableFs, OverlayFs};
use std::sync::Arc;
let mountable = MountableFs::new()
.mount("/", Arc::new(InMemoryFs::new()))
.mount("/project", Arc::new(OverlayFs::new("./myproject").unwrap()));
let mut shell = RustBashBuilder::new()
.fs(Arc::new(mountable))
.cwd("/")
.build()
.unwrap();Implementations§
Source§impl MountableFs
impl MountableFs
Trait Implementations§
Source§impl Default for MountableFs
impl Default for MountableFs
Source§impl VirtualFs for MountableFs
impl VirtualFs for MountableFs
fn read_file(&self, path: &Path) -> Result<Vec<u8>, VfsError>
fn write_file(&self, path: &Path, content: &[u8]) -> Result<(), VfsError>
fn append_file(&self, path: &Path, content: &[u8]) -> Result<(), VfsError>
fn remove_file(&self, path: &Path) -> Result<(), VfsError>
fn mkdir(&self, path: &Path) -> Result<(), VfsError>
fn mkdir_p(&self, path: &Path) -> Result<(), VfsError>
fn readdir(&self, path: &Path) -> Result<Vec<DirEntry>, VfsError>
fn remove_dir(&self, path: &Path) -> Result<(), VfsError>
fn remove_dir_all(&self, path: &Path) -> Result<(), VfsError>
fn exists(&self, path: &Path) -> bool
fn stat(&self, path: &Path) -> Result<Metadata, VfsError>
fn lstat(&self, path: &Path) -> Result<Metadata, VfsError>
fn chmod(&self, path: &Path, mode: u32) -> Result<(), VfsError>
fn utimes(&self, path: &Path, mtime: SystemTime) -> Result<(), VfsError>
fn symlink(&self, target: &Path, link: &Path) -> Result<(), VfsError>
fn hardlink(&self, src: &Path, dst: &Path) -> Result<(), VfsError>
fn readlink(&self, path: &Path) -> Result<PathBuf, VfsError>
fn canonicalize(&self, path: &Path) -> Result<PathBuf, VfsError>
fn copy(&self, src: &Path, dst: &Path) -> Result<(), VfsError>
fn rename(&self, src: &Path, dst: &Path) -> Result<(), VfsError>
fn glob(&self, pattern: &str, cwd: &Path) -> Result<Vec<PathBuf>, VfsError>
Auto Trait Implementations§
impl Freeze for MountableFs
impl !RefUnwindSafe for MountableFs
impl Send for MountableFs
impl Sync for MountableFs
impl Unpin for MountableFs
impl UnsafeUnpin for MountableFs
impl !UnwindSafe for MountableFs
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