pub trait GuestFsOps {
// Required methods
fn list_dir(
&mut self,
guest_path: &str,
) -> Result<Vec<String>, GuestFsError>;
fn read_file(&mut self, guest_path: &str) -> Result<Vec<u8>, GuestFsError>;
fn write_file(
&mut self,
guest_path: &str,
data: &[u8],
) -> Result<(), GuestFsError>;
fn mkdir(&mut self, guest_path: &str) -> Result<(), GuestFsError>;
fn remove(&mut self, guest_path: &str) -> Result<(), GuestFsError>;
}Expand description
Operations on the guest filesystem (Mode P). Paths are guest absolute paths (e.g. /workspace/foo).
Required Methods§
Sourcefn list_dir(&mut self, guest_path: &str) -> Result<Vec<String>, GuestFsError>
fn list_dir(&mut self, guest_path: &str) -> Result<Vec<String>, GuestFsError>
List non-hidden names in guest_path (like ls -1A).
§Errors
Returns GuestFsError when guest_path is invalid or guest listing fails.
Sourcefn read_file(&mut self, guest_path: &str) -> Result<Vec<u8>, GuestFsError>
fn read_file(&mut self, guest_path: &str) -> Result<Vec<u8>, GuestFsError>
Read a file by guest path.
§Errors
Returns GuestFsError when guest_path is invalid or reading fails.
Sourcefn write_file(
&mut self,
guest_path: &str,
data: &[u8],
) -> Result<(), GuestFsError>
fn write_file( &mut self, guest_path: &str, data: &[u8], ) -> Result<(), GuestFsError>
Sourcefn mkdir(&mut self, guest_path: &str) -> Result<(), GuestFsError>
fn mkdir(&mut self, guest_path: &str) -> Result<(), GuestFsError>
Create a directory (and parents), like mkdir -p.
§Errors
Returns GuestFsError when path validation or directory creation fails.
Sourcefn remove(&mut self, guest_path: &str) -> Result<(), GuestFsError>
fn remove(&mut self, guest_path: &str) -> Result<(), GuestFsError>
Remove a file or directory tree (rm -rf semantics on Lima; mock removes subtree).
§Errors
Returns GuestFsError when path validation or removal fails.
Implementors§
impl GuestFsOps for GammaSession
Available on Unix only.
GuestFsOps on the live γ session (used by REPL dispatch in guest-primary mode).
impl GuestFsOps for LimaGuestFsOps
Available on Unix only.