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).
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.
Sourcefn write_file(
&mut self,
guest_path: &str,
data: &[u8],
) -> Result<(), GuestFsError>
fn write_file( &mut self, guest_path: &str, data: &[u8], ) -> Result<(), GuestFsError>
Write or replace a file.
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.