pub struct InstallPlan {
pub commands: Vec<CommandSpec>,
pub official: Vec<String>,
pub aur: Vec<String>,
}Expand description
What: The result of planning a batch installation.
Inputs:
- Produced by
build_batch_install.
Output:
- Between zero and two commands (one pacman batch, one AUR helper batch) plus the package names routed to each.
Details:
- Commands should be executed in order: official packages first, then AUR packages (AUR builds may depend on official packages installed earlier) — matching Pacsea’s mixed-install chaining.
Fields§
§commands: Vec<CommandSpec>Commands to execute in order (pacman batch first, then AUR helper batch).
official: Vec<String>Names routed to the pacman command.
aur: Vec<String>Names routed to the AUR helper command.
Implementations§
Source§impl InstallPlan
impl InstallPlan
Sourcepub fn to_shell_string(&self) -> String
pub fn to_shell_string(&self) -> String
What: Render the plan as a single &&-chained shell command line.
Inputs:
&self: The planned commands, in execution order.
Output:
- Shell string like
sudo pacman -S ... -- <names> && paru -S --aur ... -- <names>; empty string for an empty plan.
Details:
&&chaining stops the AUR step when the pacman step fails — matching Pacsea’s mixed-install semantics. Callers executing thecommandsvector directly must replicate this by checking each command’s exit status before running the next.
§Example
use arch_toolkit::install::build_batch_install;
use arch_toolkit::types::install::{AurHelper, InstallOptions};
use arch_toolkit::PackageRef;
let targets = vec![
PackageRef::official("ripgrep", "14.0.0", "extra", "x86_64"),
PackageRef::aur("yay-bin", "12.0.0"),
];
let plan = build_batch_install(
&targets,
Some(AurHelper::Paru),
None,
&InstallOptions::default(),
None::<&std::collections::HashSet<String>>,
)?;
assert_eq!(
plan.to_shell_string(),
"pacman -S --needed --noconfirm -- ripgrep \
&& paru -S --aur --needed --noconfirm -- yay-bin"
);Trait Implementations§
Source§impl Clone for InstallPlan
impl Clone for InstallPlan
Source§fn clone(&self) -> InstallPlan
fn clone(&self) -> InstallPlan
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for InstallPlan
impl Debug for InstallPlan
Source§impl Default for InstallPlan
impl Default for InstallPlan
Source§fn default() -> InstallPlan
fn default() -> InstallPlan
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for InstallPlan
impl RefUnwindSafe for InstallPlan
impl Send for InstallPlan
impl Sync for InstallPlan
impl Unpin for InstallPlan
impl UnsafeUnpin for InstallPlan
impl UnwindSafe for InstallPlan
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
Mutably borrows from an owned value. Read more