pub struct GammaSession { /* private fields */ }Expand description
Lima-backed session: sync VFS ↔ host workspace, run tools inside the VM.
Implementations§
Source§impl GammaSession
impl GammaSession
Sourcepub fn new(config: &VmConfig) -> Result<Self, VmError>
pub fn new(config: &VmConfig) -> Result<Self, VmError>
Build a γ session from VM config (does not start the VM yet).
§Errors
Returns VmError::Lima if limactl cannot be resolved.
Sourcepub fn syncs_vfs_with_host_workspace(&self) -> bool
pub fn syncs_vfs_with_host_workspace(&self) -> bool
Whether this session push/pulls the in-memory VFS around rust tools (Mode S). false = guest-primary (WorkspaceMode::Guest).
Sourcepub fn guest_mount(&self) -> &str
pub fn guest_mount(&self) -> &str
Guest mount point (e.g. /workspace).
Sourcepub fn workspace_parent(&self) -> &Path
pub fn workspace_parent(&self) -> &Path
Host workspace root (for docs / debugging).
Sourcepub fn limactl_path(&self) -> &Path
pub fn limactl_path(&self) -> &Path
Path to limactl binary (for exec delegation).
Sourcepub fn lima_instance_name(&self) -> &str
pub fn lima_instance_name(&self) -> &str
Lima instance name (limactl shell <this> …).
Sourcepub fn guest_todo_release_path_for_shell(&self) -> Option<String>
pub fn guest_todo_release_path_for_shell(&self) -> Option<String>
If host cwd has target/release/todo under Self::workspace_parent, return guest path
to that release dir for PATH (same logic as guest_todo_release_dir_for_cwd in session helpers).
Sourcepub fn lima_interactive_shell_workdir_and_inner(&self) -> (String, String)
pub fn lima_interactive_shell_workdir_and_inner(&self) -> (String, String)
Guest --workdir and bash -lc body for super::super::SessionHolder::exec_lima_interactive_shell:
cd to the host current_dir project under the Lima workspace mount, optional $HOME/host_dir symlink,
and ~/.todo.json → ~/host_dir/.todo.json.
Trait Implementations§
Source§impl Debug for GammaSession
impl Debug for GammaSession
Source§impl GuestFsOps for GammaSession
Available on Unix only.GuestFsOps on the live γ session (used by REPL dispatch in guest-primary mode).
impl GuestFsOps for GammaSession
GuestFsOps on the live γ session (used by REPL dispatch in guest-primary mode).
Source§fn list_dir(&mut self, guest_path: &str) -> Result<Vec<String>, GuestFsError>
fn list_dir(&mut self, guest_path: &str) -> Result<Vec<String>, GuestFsError>
guest_path (like ls -1A).Source§fn read_file(&mut self, guest_path: &str) -> Result<Vec<u8>, GuestFsError>
fn read_file(&mut self, guest_path: &str) -> Result<Vec<u8>, GuestFsError>
Source§fn write_file(
&mut self,
guest_path: &str,
data: &[u8],
) -> Result<(), GuestFsError>
fn write_file( &mut self, guest_path: &str, data: &[u8], ) -> Result<(), GuestFsError>
Source§impl VmExecutionSession for GammaSession
impl VmExecutionSession for GammaSession
Source§fn ensure_ready(&mut self, _vfs: &Vfs, _vfs_cwd: &str) -> Result<(), VmError>
fn ensure_ready(&mut self, _vfs: &Vfs, _vfs_cwd: &str) -> Result<(), VmError>
Source§fn run_rust_tool(
&mut self,
vfs: &mut Vfs,
vfs_cwd: &str,
program: &str,
args: &[String],
) -> Result<ExitStatus, VmError>
fn run_rust_tool( &mut self, vfs: &mut Vfs, vfs_cwd: &str, program: &str, args: &[String], ) -> Result<ExitStatus, VmError>
rustup or cargo with cwd matching vfs_cwd; update vfs as defined by the backend.