#[non_exhaustive]pub enum WafClassifyError {
BuildError(String),
ClassifyError(String),
}Expand description
Errors returned by WafClassifier::classify.
BuildError is for classifier-internal construction problems (TOML parse
failures, AC matcher build failures). ClassifyError is for per-call
problems (e.g. response body decoding failures).
The engine treats both variants as None for dispatch purposes and logs
them at WARN — a misconfigured classifier does NOT crash the dispatcher.
§Examples
let build_err = WafClassifyError::BuildError("invalid toml".to_string());
let classify_err = WafClassifyError::ClassifyError("bad encoding".to_string());
match build_err {
WafClassifyError::BuildError(msg) => println!("Build failed: {}", msg),
WafClassifyError::ClassifyError(msg) => println!("Classify failed: {}", msg),
// `#[non_exhaustive]`: callers outside the crate must include a wildcard
// so future variants do not break their match.
_ => println!("other classify error"),
}Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
BuildError(String)
Classifier construction failed (e.g. TOML parse or AC build error).
ClassifyError(String)
Per-call classification failure (e.g. response body decoding error).
Trait Implementations§
Source§impl Clone for WafClassifyError
impl Clone for WafClassifyError
Source§fn clone(&self) -> WafClassifyError
fn clone(&self) -> WafClassifyError
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for WafClassifyError
impl Debug for WafClassifyError
Source§impl Display for WafClassifyError
impl Display for WafClassifyError
Source§impl Error for WafClassifyError
impl Error for WafClassifyError
1.30.0 · 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 WafClassifyError
impl RefUnwindSafe for WafClassifyError
impl Send for WafClassifyError
impl Sync for WafClassifyError
impl Unpin for WafClassifyError
impl UnsafeUnpin for WafClassifyError
impl UnwindSafe for WafClassifyError
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