Skip to main content

GammaSession

Struct GammaSession 

Source
pub struct GammaSession { /* private fields */ }
Expand description

Lima-backed session: sync VFS ↔ host workspace, run tools inside the VM.

Implementations§

Source§

impl GammaSession

Source

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.

Source

pub const 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).

Source

pub fn guest_mount(&self) -> &str

Guest mount point (e.g. /workspace).

Source

pub fn workspace_parent(&self) -> &Path

Host workspace root (for docs / debugging).

Source

pub fn limactl_path(&self) -> &Path

Path to limactl binary (for exec delegation).

Source

pub fn lima_instance_name(&self) -> &str

Lima instance name (limactl shell <this> …).

Source

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).

Source

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

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl GuestFsOps for GammaSession

Available on Unix only.

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>

List non-hidden names in guest_path (like ls -1A). Read more
Source§

fn read_file(&mut self, guest_path: &str) -> Result<Vec<u8>, GuestFsError>

Read a file by guest path. Read more
Source§

fn write_file( &mut self, guest_path: &str, data: &[u8], ) -> Result<(), GuestFsError>

Write or replace a file. Read more
Source§

fn mkdir(&mut self, guest_path: &str) -> Result<(), GuestFsError>

Create a directory (and parents), like mkdir -p. Read more
Source§

fn remove(&mut self, guest_path: &str) -> Result<(), GuestFsError>

Remove a file or directory tree (rm -rf semantics on Lima; mock removes subtree). Read more
Source§

impl VmExecutionSession for GammaSession

Source§

fn ensure_ready(&mut self, _vfs: &Vfs, _vfs_cwd: &str) -> Result<(), VmError>

Prepare the session (e.g. start VM, initial push). No-op for host temp export. Read more
Source§

fn run_rust_tool( &mut self, vfs: &mut Vfs, vfs_cwd: &str, program: &str, args: &[String], ) -> Result<ExitStatus, VmError>

Run rustup or cargo with cwd matching vfs_cwd; update vfs as defined by the backend. Read more
Source§

fn shutdown(&mut self, vfs: &mut Vfs, vfs_cwd: &str) -> Result<(), VmError>

Tear down (e.g. final pull, stop VM). Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.