#[non_exhaustive]pub enum SchemaError {
Io {
path: PathBuf,
source: Error,
},
Parse {
path: PathBuf,
message: String,
},
UnsupportedSchemaVersion {
path: PathBuf,
label: String,
version: u32,
},
UnknownNodeKind {
path: PathBuf,
label: String,
kind: String,
},
EmptyEnumValues {
path: PathBuf,
label: String,
param: String,
},
DuplicateEnumValue {
path: PathBuf,
label: String,
param: String,
value: String,
},
EmptyEnumValueName {
path: PathBuf,
label: String,
param: String,
},
InvalidVerbatimLabel {
path: PathBuf,
label: String,
reason: String,
},
WasmTransportDeferred {
path: PathBuf,
label: String,
},
EmptySubprocessCommand {
path: PathBuf,
label: String,
},
UnsupportedTransport {
path: PathBuf,
label: String,
transport: String,
},
}Expand description
One schema file failed to load. Variants distinguish post-deserialise
validation failures by class so callers can pattern-match on the cause.
The deserialise step is one variant — Parse — because serde_yaml
reports missing required fields, wrong-typed fields, and unknown fields
(rejected by deny_unknown_fields) all through the same error path
with line/column attribution baked into the message.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Io
Reading the file (or, for load_dir, listing the directory or one
of its entries) failed at the OS level.
Parse
The YAML body did not deserialise into a Schema. The message
is whatever serde_yaml produced — which carries line/column
information when attribution is possible. Reasons covered by
this single variant: missing required field, wrong-typed field,
unknown field rejected by deny_unknown_fields, malformed YAML.
UnsupportedSchemaVersion
schema_version is set to a value the loader doesn’t support.
Currently only 1 is recognised; future versions land with
dedicated migration paths, not a permissive accept.
UnknownNodeKind
attaches_to referenced a node kind outside the closed set
defined by HostNodeKind::ALL. The Display impl emits the
current allowed list verbatim so the error stays in sync if
new kinds are added.
EmptyEnumValues
A param declared type: enum but its values list is empty.
DuplicateEnumValue
Two EnumValue entries on the same param share a name.
EmptyEnumValueName
An EnumValue was declared with an empty name. The empty
string isn’t a useful identifier and almost always indicates a
schema typo (- name: with no value).
InvalidVerbatimLabel
verbatim_label: true was set on a label that can’t legally appear
as a verbatim block closing — typically because it contains
whitespace or the verbatim-marker sequence ::.
WasmTransportDeferred
handler.transport: wasm is reserved for a future release. The
loader rejects it with a clear deferral message rather than the
generic “unknown variant” error so users get an actionable hint.
EmptySubprocessCommand
handler.transport: subprocess declared without a non-empty
command array — the subprocess transport has nothing to spawn.
UnsupportedTransport
handler.transport is a value the loader doesn’t understand.
HandlerTransport is #[non_exhaustive] upstream; reaching this
branch means a future variant slipped past serde without being
taught to the validator. Surfacing it as an error rather than a
silent accept keeps lockstep with lex-extension.
Trait Implementations§
Source§impl Debug for SchemaError
impl Debug for SchemaError
Source§impl Display for SchemaError
impl Display for SchemaError
Source§impl Error for SchemaError
impl Error for SchemaError
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()