pub struct HostContext {
pub mode: ApplyMode,
pub paths: HostPaths,
pub setup_kind: SetupKind,
pub skip_piper: bool,
pub apply_nat: bool,
pub logs: Vec<String>,
pub planned: Vec<PlannedAction>,
prompts: Option<Box<dyn PromptsProvider>>,
pub prompt_answers: HashMap<String, String>,
}Expand description
Mutable per-run state passed into steps and kits.
Fields§
§mode: ApplyModeDry-run vs apply.
paths: HostPathsHost filesystem layout for this run.
setup_kind: SetupKindSelected Full / Minimal pipeline.
skip_piper: boolWhen true, Piper-related install paths are skipped.
apply_nat: boolWhen true, NAT-related confirms auto-accept (also set via HORTO_APPLY_NAT).
logs: Vec<String>Accumulated log lines for TUI / API surfaces (also mirrored to tracing).
planned: Vec<PlannedAction>Planned actions collected during dry-run / plan.
prompts: Option<Box<dyn PromptsProvider>>§prompt_answers: HashMap<String, String>Pre-filled answers keyed by prompt label (tests / automation).
Implementations§
Source§impl HostContext
impl HostContext
Sourcepub fn new(mode: ApplyMode, kind: SetupKind) -> Self
pub fn new(mode: ApplyMode, kind: SetupKind) -> Self
Create a context with default HostPaths and empty logs / planned actions.
apply_nat is initialized from HORTO_APPLY_NAT=1 / true when set.
Sourcepub fn with_paths(self, paths: HostPaths) -> Self
pub fn with_paths(self, paths: HostPaths) -> Self
Replace host paths (tests and alternate roots).
Sourcepub fn with_prompts(self, prompts: Box<dyn PromptsProvider>) -> Self
pub fn with_prompts(self, prompts: Box<dyn PromptsProvider>) -> Self
Attach an interactive or recording prompts provider.
Sourcepub fn plan_action(&mut self, summary: impl Into<String>)
pub fn plan_action(&mut self, summary: impl Into<String>)
Record a planned action, log it with a [plan] prefix, and push onto Self::planned.
Sourcepub fn is_dry_run(&self) -> bool
pub fn is_dry_run(&self) -> bool
True when Self::mode is ApplyMode::DryRun.