pub trait PromptHost: Send + Sync {
// Required methods
fn can_ask(&self) -> bool;
fn approver(&self) -> Box<dyn Approver>;
}Expand description
How a process answers Approve::Prompt while it executes a task’s turns,
and whether there is anyone there to ask at all.
The executor is whichever process holds a task’s attach lock (ADR-0019),
and only that process’s own environment knows whether a person — or any
other approving party — is behind it. A library has no terminal to ask at
(ADR-0011, the same reason basis-cli’s TerminalApprover lives in the
binary and not in basis), so basis-tasks does not decide this; a host
that wants Prompt to work supplies one via
Tasks::with_prompt_host. A Tasks
with none refuses Prompt the same way an unaskable process always did —
safely, and by name.
Required Methods§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".