Skip to main content

Home

Struct Home 

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

The RIG_HOME layout. Every file the launcher and the agent write lives under this one root.

Implementations§

Source§

impl Home

Source

pub fn from_env() -> Self

The root from env::HOME, else ~/.rig, made absolute so the launcher, the agent and their children agree on it from any directory.

Source

pub fn at(root: impl Into<PathBuf>) -> Self

The layout under root, made absolute: a home of its own, such as a test’s.

Source

pub fn root(&self) -> &Path

The root itself.

Source

pub fn plugins_toml(&self) -> PathBuf

plugins.toml, the plugin list.

Source

pub fn plugins(&self) -> PathBuf

plugins/, where rig plugin new makes plugin crates, outside any workspace: plugins/<name> is listed in plugins.toml as path = "plugins/<name>".

Source

pub fn settings(&self) -> PathBuf

settings.toml, the user’s settings for plugins: one table per plugin, which the agent hands to the plugin that reads it.

Source

pub fn defaults(&self) -> PathBuf

defaults.json, the model and reasoning setting a new session starts with: the last ones chosen.

Source

pub fn auth(&self) -> PathBuf

auth/, where /login keeps each subscription credential, as <provider>.json.

Source

pub fn project(&self) -> PathBuf

The generated agent project.

Source

pub fn build_log(&self) -> PathBuf

The whole output of the last build, the launcher’s and cargo’s, rewritten by every build: the one before each start and rig build, which /reload runs. Its last line says how the build ended.

Source

pub fn target(&self) -> PathBuf

Cargo’s target directory for the agent project.

Source

pub fn bin(&self) -> PathBuf

The directory of the builds and the build lock.

Source

pub fn good(&self) -> PathBuf

The last build that started up.

Source

pub fn staged(&self) -> PathBuf

The build rig build staged for whichever launcher starts next.

Source

pub fn described(&self, stamp: &str) -> PathBuf

The AgentDescription report of the build whose stamp is stamp (its modification time in nanoseconds and its length, as "{mtime} {len}"), one per build, which every copy of the build shares.

Source

pub fn rejected(&self) -> PathBuf

The stamp of the last build that stopped before it was ready.

Source

pub fn build_lock(&self) -> PathBuf

The lock every launcher on this root takes to generate, build and stage the agent.

Source

pub fn staged_for(&self, session: &SessionId) -> PathBuf

The build staged for the launcher of session alone.

Source

pub fn trial_for(&self, session: &SessionId) -> PathBuf

The build the launcher of session runs until it is ready.

Source

pub fn owner_of(name: &str) -> Option<SessionId>

The session whose launcher owns a file of Home::bin named name: a staged-<session> or trial-<session>.

Source

pub fn data(&self) -> PathBuf

data/, where plugins keep files across sessions and projects.

Source

pub fn projects(&self) -> PathBuf

projects/, where plugins keep files per project, one directory for each project the agent worked in.

Source

pub fn runs(&self) -> PathBuf

The directory holding every running launcher’s RunDir.

Source

pub fn run(&self, launcher: u32) -> RunDir

The run directory of the launcher with the process id launcher.

Source

pub fn sessions(&self) -> PathBuf

The directory holding every session’s directory.

Source

pub fn session(&self, session: &SessionId) -> SessionDir

The directory of session.

Source

pub fn new_session(&self) -> Result<(SessionId, SessionDir)>

A new session, its directory created: a SessionId::generated id, or, when a session of this home has that one, the first free one after it, such as 1700000000-42-1.

§Errors

When the directory cannot be created.

Source

pub fn saved_sessions(&self) -> Vec<(SessionId, SessionDir)>

Every saved session of this home (not one being deleted), in no order, with its directory: what every listing and Self::find read.

Source

pub fn find(&self, name_or_id: &str) -> Result<SessionId, String>

The saved session name_or_id names: the one with that id when it parses as one and is saved, else the only saved session with that SessionDir::name.

§Errors

When no saved session has that id or name, or several have that name: the error lists their ids.

Trait Implementations§

Source§

impl Clone for Home

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Home

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl Freeze for Home

§

impl RefUnwindSafe for Home

§

impl Send for Home

§

impl Sync for Home

§

impl Unpin for Home

§

impl UnsafeUnpin for Home

§

impl UnwindSafe for Home

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.