pub enum VendorResolverError {
InvalidField {
rule_id: String,
field: String,
value: String,
reason: String,
},
MissingField {
rule_id: String,
field: String,
},
DuplicateId {
rule_id: String,
},
UnknownVendor {
rule_id: String,
vendor_id: String,
},
TomlParse(Error),
}Expand description
Errors returned by vendor-resolver rule validation and loading.
Variants§
InvalidField
A field on a resolution rule failed semantic validation.
Fields
MissingField
A required field is missing from the TOML payload.
Fields
DuplicateId
The same rule id appears more than once in the input bundle.
UnknownVendor
A [[vendors]] entry referenced an unknown
crate::vendor_classifier::VendorId.
Fields
TomlParse(Error)
The TOML parser reported a structural error.
Implementations§
Source§impl VendorResolverError
impl VendorResolverError
Sourcepub fn invalid_rule(
rule_id: impl Into<String>,
field: impl Into<String>,
value: impl Display,
reason: impl Into<String>,
) -> Self
pub fn invalid_rule( rule_id: impl Into<String>, field: impl Into<String>, value: impl Display, reason: impl Into<String>, ) -> Self
Convenience constructor for VendorResolverError::InvalidField.
Sourcepub fn missing_field(
rule_id: impl Into<String>,
field: impl Into<String>,
) -> Self
pub fn missing_field( rule_id: impl Into<String>, field: impl Into<String>, ) -> Self
Convenience constructor for VendorResolverError::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 VendorResolverError
impl Debug for VendorResolverError
Source§impl Display for VendorResolverError
impl Display for VendorResolverError
Source§impl Error for VendorResolverError
impl Error for VendorResolverError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Auto Trait Implementations§
impl Freeze for VendorResolverError
impl RefUnwindSafe for VendorResolverError
impl Send for VendorResolverError
impl Sync for VendorResolverError
impl Unpin for VendorResolverError
impl UnsafeUnpin for VendorResolverError
impl UnwindSafe for VendorResolverError
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
Mutably borrows from an owned value. Read more