pub struct LoopDetectedError {
pub tool_name: String,
pub tool_args: Value,
pub count: usize,
pub window: usize,
pub threshold: usize,
}Expand description
Raised when the same (tool_name, args) pair fires too often.
Carries the full context needed to surface a useful diagnostic to the
caller: which tool was looping, what args it was called with on the
offending call, how many times the key has been seen inside the window,
and the guard’s configured window / threshold.
Fields§
§tool_name: StringName of the offending tool.
tool_args: ValueThe args object that was matched (last recorded form).
count: usizeHow many times the key was seen inside the window.
window: usizeConfigured window size.
threshold: usizeConfigured threshold.
Trait Implementations§
Source§impl Clone for LoopDetectedError
impl Clone for LoopDetectedError
Source§fn clone(&self) -> LoopDetectedError
fn clone(&self) -> LoopDetectedError
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 LoopDetectedError
impl Debug for LoopDetectedError
Source§impl Display for LoopDetectedError
impl Display for LoopDetectedError
Source§impl Error for LoopDetectedError
impl Error for LoopDetectedError
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 LoopDetectedError
impl PartialEq for LoopDetectedError
Source§fn eq(&self, other: &LoopDetectedError) -> bool
fn eq(&self, other: &LoopDetectedError) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Eq for LoopDetectedError
impl StructuralPartialEq for LoopDetectedError
Auto Trait Implementations§
impl Freeze for LoopDetectedError
impl RefUnwindSafe for LoopDetectedError
impl Send for LoopDetectedError
impl Sync for LoopDetectedError
impl Unpin for LoopDetectedError
impl UnsafeUnpin for LoopDetectedError
impl UnwindSafe for LoopDetectedError
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