Skip to main content

HarnessKind

Enum HarnessKind 

Source
pub enum HarnessKind {
    ClaudeCode,
    OpenCode,
    GeminiCli,
    Codex,
    KimiCode,
    QwenCode,
    AntigravityIde,
}
Expand description

A harness QCode can build a profile image for.

Variants§

§

ClaudeCode

Claude Code.

§

OpenCode

opencode.

§

GeminiCli

Gemini CLI.

§

Codex

Codex CLI.

§

KimiCode

Kimi Code CLI.

§

QwenCode

Qwen Code.

§

AntigravityIde

Antigravity IDE, which opens a window instead of drawing in a terminal.

Implementations§

Source§

impl HarnessKind

Source

pub fn history_script(self) -> Option<&'static str>

The Node script that prints this harness’s conversations in the workspace whose folder is its first argument, in the shape parse reads.

None for a harness whose conversations QCode cannot list: the window harness keeps its own, under HarnessKind::conversation_paths, in a shape that was never read, and a list guessed at would offer conversations that do not open.

Source

pub fn conversation_paths(self) -> &'static [&'static str]

Where this harness keeps its conversations, relative to the home directory: the folders and files the scripts above read, and nothing beside them.

This is what a backup of a profile’s conversations takes, and it is a list of what may go rather than of what may not: the backup is a plain folder on the machine, and a new harness version that puts its login somewhere new would slip past a list of what to leave out, never past this one. opencode’s list is its database and the two journals SQLite keeps beside it, because the three only make one database together.

Source

pub fn conversation_database(self) -> Option<&'static str>

The database this harness keeps its conversations in, when it keeps them in one, relative to the home directory. Its journals are the same path with -wal and -shm after it.

A database copied while the harness writes to it can be a torn copy, and its journal only fits the database it was written with; so a harness with one is only backed up and brought back while it is stopped.

Source§

impl HarnessKind

Source

pub const ALL: [Self; 7]

Every harness, in the order the profile wizard offers them. The ones that draw in a terminal come first, because that is what nearly every profile is.

Source

pub const TERMINAL: [Self; 6]

The harnesses that draw in the tab’s own terminal, in the same order.

Most of what QCode knows about a harness — the install from a registry, the unattended arguments, the conversation script, the login file it carries — is only true of these.

Source

pub fn record(self) -> &'static Harness

What QCode knows about this harness.

Source

pub fn desktop(self) -> Option<&'static Desktop>

The window this harness opens, when it opens one rather than drawing in a terminal.

Source

pub fn offered_offline(self) -> bool

Whether a profile whose containers reach no network is offered for this harness.

Antigravity IDE is not: it does not open without signing in to Google, and every answer it gives comes from Google’s servers, so a container without the network holds a window that can do nothing. Every other harness here can at least be pointed at a provider on this machine, or carries a login made once and kept.

Source

pub fn parse(id: &str) -> Option<Self>

The harness written as id, if there is one.

Source

pub fn supports(self, account: AccountKind) -> bool

Whether the harness can sign in with account.

Source

pub fn withdrawn(self, account: AccountKind) -> bool

Whether account is one the harness no longer offers to new profiles.

Source

pub fn command_line(self, conversation: Option<&str>) -> Vec<String>

The program and arguments a tab runs inside the profile’s container: the harness in unattended mode, opening conversation when one is given and a new one otherwise.

An id that history::is_safe_id would not have let through is not passed on: a word starting with - would be read as an option, so the harness is started as if none had been asked for rather than with an argument nobody chose. Nor is one given to a harness that has no way of being told to open a conversation again.

Trait Implementations§

Source§

impl Clone for HarnessKind

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 Copy for HarnessKind

Source§

impl Debug for HarnessKind

Source§

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

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

impl Eq for HarnessKind

Source§

impl PartialEq for HarnessKind

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for HarnessKind

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> 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> Downcast for T
where T: Any,

Source§

fn into_any(self: Box<T>) -> Box<dyn Any>

Convert Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.
Source§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

Convert Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait.
Source§

fn as_any(&self) -> &(dyn Any + 'static)

Convert &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s.
Source§

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
Source§

impl<T> DowncastSync for T
where T: Any + Send + Sync,

Source§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Send + Sync> ⓘ

Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait.
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
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.