pub enum ConvergenceConfigError {
WindowTooSmall {
actual: usize,
},
ThresholdOutOfRange {
actual: f32,
},
}Expand description
Error returned when ConvergenceConfig validation fails.
ConvergenceDetector::new validates the configuration before
constructing a detector. If any constraint is violated, it returns
one of these variants with enough context to produce an actionable
diagnostic message.
§Example
use loopctl::detection::convergence::{ConvergenceConfig, ConvergenceDetector, ConvergenceConfigError};
let bad_config = ConvergenceConfig {
window_size: 1,
..Default::default()
};
let err = ConvergenceDetector::new(bad_config).unwrap_err();
assert!(matches!(err, ConvergenceConfigError::WindowTooSmall { actual: 1 }));Variants§
WindowTooSmall
window_size is below the minimum of 2.
Convergence requires at least one pair of consecutive responses, so a window of 1 (or 0) is meaningless.
ThresholdOutOfRange
similarity_threshold is outside the valid range [0.0, 1.0].
Jaccard similarity always produces a value in this range; a threshold outside it would never (or always) trigger.
Trait Implementations§
Source§impl Clone for ConvergenceConfigError
impl Clone for ConvergenceConfigError
Source§fn clone(&self) -> ConvergenceConfigError
fn clone(&self) -> ConvergenceConfigError
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 ConvergenceConfigError
impl Debug for ConvergenceConfigError
Source§impl Display for ConvergenceConfigError
impl Display for ConvergenceConfigError
Source§impl Error for ConvergenceConfigError
impl Error for ConvergenceConfigError
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()
Source§impl PartialEq for ConvergenceConfigError
impl PartialEq for ConvergenceConfigError
Source§fn eq(&self, other: &ConvergenceConfigError) -> bool
fn eq(&self, other: &ConvergenceConfigError) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for ConvergenceConfigError
Auto Trait Implementations§
impl Freeze for ConvergenceConfigError
impl RefUnwindSafe for ConvergenceConfigError
impl Send for ConvergenceConfigError
impl Sync for ConvergenceConfigError
impl Unpin for ConvergenceConfigError
impl UnsafeUnpin for ConvergenceConfigError
impl UnwindSafe for ConvergenceConfigError
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