pub struct ChallengeFeedbackPolicy { /* private fields */ }Expand description
Configurable knobs for the challenge-aware policy feedback loop.
All fields are bounded by the documented safety constants —
with_max_delta clamps the supplied
value to [-MAX_RISK_DELTA, +MAX_RISK_DELTA].
§Example
use stygian_charon::challenge_feedback::{ChallengeFeedbackPolicy, MAX_RISK_DELTA};
use std::time::Duration;
let policy = ChallengeFeedbackPolicy::default();
assert!(policy.max_delta().abs() <= MAX_RISK_DELTA);
assert_eq!(policy.ttl(), Duration::from_mins(10));Implementations§
Source§impl ChallengeFeedbackPolicy
impl ChallengeFeedbackPolicy
Sourcepub fn new(max_delta: f64, ttl: Duration) -> Self
pub fn new(max_delta: f64, ttl: Duration) -> Self
Build a feedback policy with a custom clamp and TTL. The
supplied max_delta is clamped to [-MAX_RISK_DELTA, +MAX_RISK_DELTA] so callers cannot widen the documented
safety bound.
Sourcepub fn with_max_delta(self, max_delta: f64) -> Self
pub fn with_max_delta(self, max_delta: f64) -> Self
Replace the per-key clamp. Clamped to [-MAX_RISK_DELTA, +MAX_RISK_DELTA].
Trait Implementations§
Source§impl Clone for ChallengeFeedbackPolicy
impl Clone for ChallengeFeedbackPolicy
Source§fn clone(&self) -> ChallengeFeedbackPolicy
fn clone(&self) -> ChallengeFeedbackPolicy
Returns a duplicate of the value. Read more
1.0.0 · 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 ChallengeFeedbackPolicy
impl Debug for ChallengeFeedbackPolicy
Source§impl Default for ChallengeFeedbackPolicy
impl Default for ChallengeFeedbackPolicy
Source§impl PartialEq for ChallengeFeedbackPolicy
impl PartialEq for ChallengeFeedbackPolicy
impl Copy for ChallengeFeedbackPolicy
impl StructuralPartialEq for ChallengeFeedbackPolicy
Auto Trait Implementations§
impl Freeze for ChallengeFeedbackPolicy
impl RefUnwindSafe for ChallengeFeedbackPolicy
impl Send for ChallengeFeedbackPolicy
impl Sync for ChallengeFeedbackPolicy
impl Unpin for ChallengeFeedbackPolicy
impl UnsafeUnpin for ChallengeFeedbackPolicy
impl UnwindSafe for ChallengeFeedbackPolicy
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