pub struct Draft {Show 17 fields
pub stage: Stage,
pub name: String,
pub renamed: bool,
pub harness: HarnessKind,
pub template: Template,
pub parts: Vec<Extra>,
pub account: AccountKind,
pub providers: Vec<ProviderEntry>,
pub provider_tag: Option<String>,
pub provider_pick: Option<Pick>,
pub model_filter: String,
pub assets: MountAccess,
pub network: NetworkMode,
pub os: Os,
pub build: Build,
pub log: LogBuffer,
pub login: Login,
/* private fields */
}Expand description
Everything the wizard has been told so far.
Fields§
§stage: StageThe page being shown.
name: StringThe name as it has been typed.
renamed: boolWhether the name has been edited by hand; until it has, choosing a harness renames it.
harness: HarnessKindThe chosen harness.
template: TemplateThe row the template page’s picker reads: the ready-made set last chosen while the switches
still read as it, and Custom once they do not (Draft::preset).
parts: Vec<Extra>The parts the image carries, each switched on or off on the template page.
account: AccountKindThe chosen account type.
providers: Vec<ProviderEntry>The providers the person has added, as the Providers page last had them, for the account page to offer when the chosen harness can be pointed at one of its own.
provider_tag: Option<String>The tag of the chosen provider, while account is AccountKind::Provider.
provider_pick: Option<Pick>What is asked for of the chosen provider: one of its models, or one of its lineups, while
account is AccountKind::Provider.
model_filter: StringWhat has been typed into the model list’s filter, which is what a provider offering hundreds of models is read by.
assets: MountAccessHow Assets/ is mounted.
network: NetworkModeWhat the container may reach.
os: OsThe system the image is built on.
build: BuildHow far the build has got.
log: LogBufferEvery line the build has printed.
login: LoginHow far the login has got.
Implementations§
Source§impl Draft
impl Draft
Sourcepub fn new(
taken: impl IntoIterator<Item = String>,
providers: Vec<ProviderEntry>,
) -> Self
pub fn new( taken: impl IntoIterator<Item = String>, providers: Vec<ProviderEntry>, ) -> Self
A new draft for a store whose profiles are called taken, offering providers on the
account page for a harness that can be pointed at one.
Sourcepub fn for_login(profile: &Profile) -> Self
pub fn for_login(profile: &Profile) -> Self
A draft that only signs profile in: the image is already there, so the login page is
the whole of it. This is how a login that was interrupted is picked up again.
Sourcepub fn for_rebuild(profile: &Profile) -> Self
pub fn for_rebuild(profile: &Profile) -> Self
A draft that only builds profile’s image again: the image page is the whole of it, and
the build has not started. Nothing of the profile changes but its image.
Sourcepub fn for_edit(profile: &Profile, providers: Vec<ProviderEntry>) -> Self
pub fn for_edit(profile: &Profile, providers: Vec<ProviderEntry>) -> Self
A draft that changes profile: the whole wizard, from its first page, with everything the
profile says already chosen and providers offered on the account page. The name stays as
it is, because the profile’s image, its login and every workspace’s home of it are named
after it.
Sourcepub fn is_editing(&self) -> bool
pub fn is_editing(&self) -> bool
Whether this draft changes a profile that exists.
Sourcepub fn rebuilds(&self) -> bool
pub fn rebuilds(&self) -> bool
Whether saving the changes builds the image again: the recipe of the profile as it is now
is not the recipe it was built from. The harness, the template and its parts, the system,
and an account whose kind the image is kept to all change the recipe; the network, the
access to Assets/ and the provider’s model do not, since they belong to the containers.
Sourcepub fn signs_in_again(&self) -> bool
pub fn signs_in_again(&self) -> bool
Whether the changes need a new sign-in: the profile signs in, and either with another kind of account or to another harness than the login it has was made for.
Sourcepub fn extra_download_failed(&self) -> bool
pub fn extra_download_failed(&self) -> bool
Whether the build failed because a step of QCode extra could not download what it
installs, which the step says in words of its own (recipe::EXTRA_FAILED) in the log.
Sourcepub fn dev_download_failed(&self) -> bool
pub fn dev_download_failed(&self) -> bool
Whether the build failed because a step of Quvyta development could not download what it
installs, which the step says in words of its own (recipe::DEV_FAILED) in the log.
Sourcepub fn recommended_download_failed(&self) -> bool
pub fn recommended_download_failed(&self) -> bool
Whether the build failed because a step of QCode recommended could not download what it
installs, which the step says in words of its own (recipe::RECOMMENDED_FAILED) in the log.
Sourcepub fn slim_download_failed(&self) -> bool
pub fn slim_download_failed(&self) -> bool
Whether the build failed because a step of oh my opencode slim could not download what it
installs, which the step says in words of its own (recipe::SLIM_FAILED) in the log.
Sourcepub fn custom_download_failed(&self) -> bool
pub fn custom_download_failed(&self) -> bool
Whether the build failed because a step of a profile whose parts are its own could not
download what it installs, which the step says in words of its own
(recipe::CUSTOM_FAILED) in the log.
Sourcepub fn is_only_login(&self) -> bool
pub fn is_only_login(&self) -> bool
Whether this draft is only a login for a profile that already exists.
Sourcepub fn is_only_rebuild(&self) -> bool
pub fn is_only_rebuild(&self) -> bool
Whether this draft only builds the image of a profile that already exists again.
Sourcepub fn choose_harness(&mut self, harness: HarnessKind)
pub fn choose_harness(&mut self, harness: HarnessKind)
Chooses a harness. While the name has not been touched it follows the harness, and a different harness brings its own first account type: the account page comes after this one, and each harness offers its own list, headed by the one most people start with.
The parts follow the harness too. A ready-made set stays that set and gives what it gives for the new harness, or QCode recommended where the set is not offered. A set of the person’s own keeps the parts this harness can have, so moving from Claude Code to opencode does not take graphify away.
Sourcepub fn provider_models(&self) -> &[Model]
pub fn provider_models(&self) -> &[Model]
The models of the chosen provider, or none while no provider is chosen or it offers none yet: a provider the person has not asked to list is added with an empty list, and its own page is where that is fixed.
Sourcepub fn provider_lineups(&self) -> &[Lineup]
pub fn provider_lineups(&self) -> &[Lineup]
The lineups of the chosen provider, or none while no provider is chosen. A lineup is the person’s own order of that provider’s models, written on the Providers page; a provider that has none is a provider that is simply not given one.
Sourcepub fn chosen_model(&self) -> Option<&String>
pub fn chosen_model(&self) -> Option<&String>
The model the account page has chosen, when what it has chosen is a model rather than a lineup. The list’s rows are models as well as lineups, so this is only what a caller that asks about the model has an answer for.
Sourcepub fn pick_rows(&self) -> Vec<PickRow<'_>>
pub fn pick_rows(&self) -> Vec<PickRow<'_>>
The rows of the account page’s list: the chosen provider’s lineups first and under a heading of their own, then its models under a heading of their own, with a gap between them. A provider with no lineup of its own is not given a heading for one, so its list is the models alone as it was.
One filter leaves both, because one box on the page filters both: a person who has heard of
qwen3-coder and of the lineup coder is looking for either, and a box that found only
one of them would read as the other not being there. What the filter leaves out is not
unchosen: the chosen pick is a name, and it stays what it is until another row is pressed.
Nothing at all when the filter leaves neither, so the list says so in its own words rather than showing a heading over nothing.
Sourcepub fn chosen_row(&self) -> Option<usize>
pub fn chosen_row(&self) -> Option<usize>
The row of the list the page stands on: the one the chosen pick is on, while the filter leaves it there. A pick the filter hides is on no row, which is not a row selected.
Sourcepub fn pick_at(&self, index: usize) -> Option<Pick>
pub fn pick_at(&self, index: usize) -> Option<Pick>
The pick the row at index stands for, and None for a heading, a gap, or a row that is
not there: none of those is something to choose, and a person clicking past the end of a
list expects nothing to change.
Sourcepub fn paid_steps(&self) -> Vec<String>
pub fn paid_steps(&self) -> Vec<String>
The steps a request on the chosen pick would spend money on if it landed on one: a lineup’s own paid steps, or the one model itself when it is a paid one. Empty for a pick nobody has made yet, and for a step whose price nobody published, which is not the same as a free one.
Sourcepub fn unknown_windows(&self) -> Vec<String>
pub fn unknown_windows(&self) -> Vec<String>
The steps of the chosen pick whose window nobody has measured, so a harness told nothing works to a figure of its own and may lose the front of a long prompt without a word. The one model of a single-model pick, or the steps of a lineup no step of which is known.
Sourcepub fn matching_models(&self) -> Vec<&Model>
pub fn matching_models(&self) -> Vec<&Model>
The models of the chosen provider that the filter keeps, in the provider’s own order.
A service such as OpenRouter offers hundreds of models and a page holds a handful, so the list shows what is asked for. What the filter hides is not unchosen: the chosen model is a name, and it stays what it is until another one is chosen.
Sourcepub fn choose_provider(&mut self, tag: &str)
pub fn choose_provider(&mut self, tag: &str)
Chooses the provider tagged tag, and with it the first lineup it is known to offer, or
the first model it offers when it has no lineup, so that picking a provider that already has
something to run on chose it for the person rather than leaving a second, empty choice
behind it. What was asked for in the provider left behind is of no use here, and a filter
matching none of this provider’s models would show an empty list.
Sourcepub fn offer_providers(&mut self, providers: Vec<ProviderEntry>)
pub fn offer_providers(&mut self, providers: Vec<ProviderEntry>)
Offers providers from now on, as the file has them after the person was away on the
Providers page. A provider account keeps the provider and what it runs on where they are
still there, and otherwise takes the first of what is offered now, the way picking the
account does: the page told the person to add one and come back, so the one they added is
the one they meant.
Sourcepub fn choose_provider_model(&mut self, id: &str)
pub fn choose_provider_model(&mut self, id: &str)
Chooses the model id of the provider already chosen.
Sourcepub fn choose_pick_row(&mut self, index: usize)
pub fn choose_pick_row(&mut self, index: usize)
Chooses what the row at index of the account page’s list stands for: one of the chosen
provider’s lineups, or one of its models. A row that is not there, a heading and a gap
choose nothing, as a person clicking past the end of a list expects.
Sourcepub fn stages(&self) -> &'static [Stage]
pub fn stages(&self) -> &'static [Stage]
The pages this draft goes through. A profile that signs in to nothing has no sign-in page: a step that could only say “nothing to do” would still have to be walked through.
A profile being changed has one only when the changes need a new sign-in: the login it has is kept otherwise, and asking for it again would only make the person do it twice.
Sourcepub fn profile(&self) -> Option<Profile>
pub fn profile(&self) -> Option<Profile>
The profile the draft describes, if the name is usable and, for a provider account, both a provider and a model have been chosen.
A ready-made set the picker reads is written as itself. The switches of a set of the
person’s own are written in the terms an older QCode builds the same way where there are
such terms (Template::written_as), and as Custom only where there are not.
Sourcepub fn offered(&self) -> Vec<Extra>
pub fn offered(&self) -> Vec<Extra>
Every part this profile can have, whatever the picker reads: the list the page shows.
Sourcepub fn adds_anything(&self) -> bool
pub fn adds_anything(&self) -> bool
Whether anything is downloaded into the image beside the harness: the recommended settings are written, not downloaded.
Sourcepub fn switch(&mut self, extra: Extra, on: bool)
pub fn switch(&mut self, extra: Extra, on: bool)
Switches extra on or off, and the picker reads Custom unless the switches are now exactly
a ready-made set. The two teams of agents opencode has exclude each other: each one
switched on switches the other off, since a container runs one of them, not both. A part the
chosen system has none of stays off; its switch is disabled.
Sourcepub fn choose(&mut self, template: Template)
pub fn choose(&mut self, template: Template)
Chooses the picker’s row template: a ready-made set switches on every part it gives and
every other part off. Custom switches every part off, which is the harness as it comes, the
start of a set of the person’s own.
Sourcepub fn choose_os(&mut self, os: Os)
pub fn choose_os(&mut self, os: Os)
Chooses the system the image is built on. A part the new system has none of is switched off: no image can carry it there.
Sourcepub fn chromium_refused(&self) -> bool
pub fn chromium_refused(&self) -> bool
Whether the chosen system has no Chromium that runs in a container, which the page says beside the switch it cannot move.
Sourcepub fn safe_name(&self) -> Option<SafeName>
pub fn safe_name(&self) -> Option<SafeName>
The name as it will be written, which is not always the name as it was typed.
Sourcepub fn harnesses(&self) -> Vec<HarnessKind>
pub fn harnesses(&self) -> Vec<HarnessKind>
The harnesses the first page offers: all of them, less the ones that mean nothing in a container with no network while that is what the profile’s containers are to get.
Sourcepub fn networks(&self) -> Vec<NetworkMode>
pub fn networks(&self) -> Vec<NetworkMode>
The network modes the permissions page offers: both, less no network at all for a harness that means nothing without it.
Sourcepub fn is_busy(&self) -> bool
pub fn is_busy(&self) -> bool
Whether the wizard should show its buttons as working and ignore them.
Sourcepub fn building(&mut self, task: TaskId)
pub fn building(&mut self, task: TaskId)
The build has started in task, so the silence the page warns about begins now: a build
that has only just begun has said nothing, and nothing yet.
Sourcepub fn is_building(&self) -> bool
pub fn is_building(&self) -> bool
Whether the image build is running.
Sourcepub fn build_looked(&mut self, now: Instant, quiet: Duration)
pub fn build_looked(&mut self, now: Instant, quiet: Duration)
Whether the build has said nothing for longer than quiet as of now, which is what the
page says under its own words about the build. A draft that is not building says no
whatever its silence is: there is no build to be stuck.
Sourcepub fn is_stuck(&self) -> bool
pub fn is_stuck(&self) -> bool
Whether the build has been quiet long enough to be said to be stuck, which is never said of a build that has ended.
Sourcepub fn build_said(&mut self)
pub fn build_said(&mut self)
Notes that the build has said something, so that the silence is counted from this moment and the warning under the page’s own words goes away.
Sourcepub fn build_ended(&mut self)
pub fn build_ended(&mut self)
The build has ended, so there is no build left to be stuck: the warning goes with it here rather than standing until the next look noticed, since the page stays up to say how the build ended.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Draft
impl RefUnwindSafe for Draft
impl Send for Draft
impl Sync for Draft
impl Unpin for Draft
impl UnsafeUnpin for Draft
impl UnwindSafe for Draft
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
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>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
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)
fn as_any(&self) -> &(dyn Any + 'static)
&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)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&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
impl<T> DowncastSync for T
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
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