pub struct DeclaredCommandContract {
pub name: String,
pub parameters: Vec<CommandParameterContract>,
pub program: Vec<String>,
pub args: Vec<ArgvSlot>,
pub env: Vec<EnvBindingContract>,
pub cwd: Option<String>,
pub hardened_path: Option<FillTemplate>,
pub timeout_ms: Option<i64>,
pub timeout_owner: Option<String>,
}Expand description
The emitted, executable form of one declared command.
Fields§
§name: StringThe declaration’s own name, carried so a refusal can say which command it is talking about.
parameters: Vec<CommandParameterContract>The declared parameters, in declared order.
program: Vec<String>The invocation: the program and the subcommand words that qualify it, as literal argv elements. Never a fill — a caller-supplied value must never choose which program executes.
args: Vec<ArgvSlot>The argument slots, in declared order, which IS the argv order.
env: Vec<EnvBindingContract>The declared environment bindings, in declared order.
cwd: Option<String>The declared working directory, verbatim — any {workspace_root}
placeholder unexpanded, because expanding it is the executing side’s
act against ITS workspace.
hardened_path: Option<FillTemplate>The hardened PATH, if the declaration states one.
timeout_ms: Option<i64>The declared timeout in milliseconds, if the declaration states one.
None means the declaration stated NONE, and that is a legal declared
state. Nothing here substitutes a ceiling: a number this surface
invented would be indistinguishable from one an author chose.
timeout_owner: Option<String>Who owns the declared timeout, when there is one.
Implementations§
Source§impl DeclaredCommandContract
impl DeclaredCommandContract
Sourcepub fn parameter_names(&self) -> Vec<&str>
pub fn parameter_names(&self) -> Vec<&str>
Every parameter name this command declares, in declared order.
Sourcepub fn render(
&self,
supplied: &BTreeMap<String, ArgumentValue>,
) -> Result<RenderedCommand, RenderError>
pub fn render( &self, supplied: &BTreeMap<String, ArgumentValue>, ) -> Result<RenderedCommand, RenderError>
Resolve this command against supplied.
supplied must name only parameters this command declares — a name it
does not is refused rather than ignored, because a value nothing
consumes is a value nobody reviewed. A caller holding a WIDER set (an
action’s parameters, say, of which the command uses some) narrows it
first with Self::parameter_names.
§Errors
Returns the first refusal the resolution earns: an undeclared or missing argument, a shape mismatch against a declared type, or a leading-dash operand standing where the program still reads options.
Trait Implementations§
Source§impl Clone for DeclaredCommandContract
impl Clone for DeclaredCommandContract
Source§fn clone(&self) -> DeclaredCommandContract
fn clone(&self) -> DeclaredCommandContract
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for DeclaredCommandContract
impl Debug for DeclaredCommandContract
Source§impl<'de> Deserialize<'de> for DeclaredCommandContract
impl<'de> Deserialize<'de> for DeclaredCommandContract
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for DeclaredCommandContract
Source§impl PartialEq for DeclaredCommandContract
impl PartialEq for DeclaredCommandContract
Source§impl Serialize for DeclaredCommandContract
impl Serialize for DeclaredCommandContract
impl StructuralPartialEq for DeclaredCommandContract
Auto Trait Implementations§
impl Freeze for DeclaredCommandContract
impl RefUnwindSafe for DeclaredCommandContract
impl Send for DeclaredCommandContract
impl Sync for DeclaredCommandContract
impl Unpin for DeclaredCommandContract
impl UnsafeUnpin for DeclaredCommandContract
impl UnwindSafe for DeclaredCommandContract
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.