pub enum KbError {
Parse(Error),
Invalid(String),
}Expand description
Why a knowledge base failed to load.
The two cases are different kinds of wrong and a caller may want to treat
them differently: Parse means the JSON does not describe
a knowledge base at all, while Invalid means it
deserialized fine but breaks an invariant the analysis relies on. Neither is
reachable from load with the embedded bases — those are validated by the
test suite — but both are reachable once you deserialize a
KnowledgeBase of your own and call KnowledgeBase::validate.
Variants§
Parse(Error)
The JSON could not be deserialized into a KnowledgeBase.
Invalid(String)
The knowledge base deserialized but violates a cross-field invariant. Carries the offending entry’s id and what it broke.
Trait Implementations§
Source§impl Error for KbError
impl Error for KbError
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 !RefUnwindSafe for KbError
impl !UnwindSafe for KbError
impl Freeze for KbError
impl Send for KbError
impl Sync for KbError
impl Unpin for KbError
impl UnsafeUnpin for KbError
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