pub enum VendorError {
InvalidField {
vendor_id: String,
field: String,
value: String,
reason: String,
},
MissingField {
vendor_id: String,
field: String,
},
DuplicateId {
vendor_id: String,
},
UnknownVendorId {
vendor_id: String,
},
TomlParse(Error),
}Expand description
Errors returned by vendor-definition validation and loading.
Every variant embeds the vendor id and, where applicable, the
field path (a dotted path such as signals[2].weight) plus
the bad value as a string. The Display impl formats all three
so the operator-facing message is actionable without any
auxiliary lookup.
Variants§
InvalidField
A field failed semantic validation (empty pattern, out-of-range weight, unknown source, etc.).
Fields
MissingField
A required field is missing from the TOML payload.
Fields
DuplicateId
The same vendor id appears more than once in the input bundle.
UnknownVendorId
The vendor id from the TOML does not match the
crate::vendor_classifier::VendorId
taxonomy.
TomlParse(Error)
The TOML parser reported a structural error.
Implementations§
Source§impl VendorError
impl VendorError
Sourcepub fn invalid_field(
vendor_id: impl Into<String>,
field: impl Into<String>,
value: impl Display,
reason: impl Into<String>,
) -> Self
pub fn invalid_field( vendor_id: impl Into<String>, field: impl Into<String>, value: impl Display, reason: impl Into<String>, ) -> Self
Convenience constructor for VendorError::InvalidField.
Sourcepub fn missing_field(
vendor_id: impl Into<String>,
field: impl Into<String>,
) -> Self
pub fn missing_field( vendor_id: impl Into<String>, field: impl Into<String>, ) -> Self
Convenience constructor for VendorError::MissingField.
Sourcepub fn field_path(&self) -> Option<&str>
pub fn field_path(&self) -> Option<&str>
Field path (dotted JSON-pointer-style) when applicable.
Trait Implementations§
Source§impl Debug for VendorError
impl Debug for VendorError
Source§impl Display for VendorError
impl Display for VendorError
Source§impl Error for VendorError
impl Error for VendorError
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()