pub enum ToolValidationError {
Show 20 variants
EmptyVersion,
EmptyCommandTree,
CommandIndexOutOfBounds {
index: i32,
len: usize,
},
InvalidIdentifier {
kind: &'static str,
value: String,
},
DuplicateSubcommandName {
parent: String,
name: String,
},
DuplicateName {
command: String,
name: String,
},
DuplicateShort {
command: String,
short: char,
},
UnresolvedConstraintRef {
command: String,
name: String,
},
ValueIsTypeMismatch {
command: String,
name: String,
},
DefaultTypeMismatch {
command: String,
name: String,
},
RepeatableMapTypeNotMap {
command: String,
name: String,
},
UnresolvedTypeRef {
command: String,
position: String,
id: String,
},
IllFormedSchema {
command: String,
position: String,
detail: String,
},
DuplicateTypeId {
id: String,
},
UnresolvedDefaultFormatter {
command: String,
formatter: String,
},
VerbatimWithoutSeparator {
command: String,
positional: String,
},
VariantInInputPosition {
command: String,
position: String,
},
UnreachableCommandNode {
index: i32,
},
CommandTreeCycle {
index: i32,
},
DuplicateCommandParent {
index: i32,
},
}Expand description
A single producer-side construction-invariant violation.
Variants§
EmptyVersion
A tool version must contain at least one non-whitespace character.
EmptyCommandTree
The command tree has no nodes (it must contain at least the root).
CommandIndexOutOfBounds
A command-index references a node outside the command tree.
InvalidIdentifier
An identifier-like string does not match is_valid_identifier.
DuplicateSubcommandName
Two sibling subcommands share a name or alias.
DuplicateName
Two names (option/flag long names, aliases, positional names) collide within a command body’s scope (including inherited globals).
DuplicateShort
Two short forms collide within a command body’s scope.
UnresolvedConstraintRef
A constraint ref names something not in scope.
ValueIsTypeMismatch
A value-is literal is not a valid value for the referenced name’s
declared type.
DefaultTypeMismatch
A default literal is not a valid value for its option/positional’s
declared type (a repeatable option’s default must be a list of its
element type).
RepeatableMapTypeNotMap
A repeatable-map option’s collected map_type does not resolve to a
SchemaType::Map (the collected key-value value must be a map node).
UnresolvedTypeRef
An embedded type contains a SchemaType::Ref whose id does not
resolve to a definition in the tool’s SchemaGraph.
IllFormedSchema
An embedded type is not structurally well-formed (for example an
inverted numeric min > max, an empty variant, or a non-primitive map
key), as reported by schema well-formedness validation.
DuplicateTypeId
Two definitions in the tool’s SchemaGraph share the same type id; the
wire encoder requires definition ids to be unique.
UnresolvedDefaultFormatter
A body’s default-formatter does not resolve to one of its formatters.
VerbatimWithoutSeparator
A tail-positional declares verbatim = true without a separator.
VariantInInputPosition
A variant type is reachable from an input position; input-side
discrimination must use union instead.
UnreachableCommandNode
A command-tree node is not reachable from the root.
CommandTreeCycle
The command tree contains a cycle.
DuplicateCommandParent
A command-tree node is referenced as a subcommand by more than one parent (the command graph is a DAG, not a tree).
Trait Implementations§
Source§impl Clone for ToolValidationError
impl Clone for ToolValidationError
Source§fn clone(&self) -> ToolValidationError
fn clone(&self) -> ToolValidationError
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 ToolValidationError
impl Debug for ToolValidationError
Source§impl Display for ToolValidationError
impl Display for ToolValidationError
impl Eq for ToolValidationError
Source§impl Error for ToolValidationError
impl Error for ToolValidationError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()