pub struct GuardrailRegistry { /* private fields */ }Expand description
Per-(tenant, route) guardrail state.
Implementations§
Source§impl GuardrailRegistry
impl GuardrailRegistry
Sourcepub fn is_demoted(&self, tenant: &str, route_ix: usize, now_secs: i64) -> bool
pub fn is_demoted(&self, tenant: &str, route_ix: usize, now_secs: i64) -> bool
Whether this route is currently demoted and must take the observe path.
Fails closed toward safety: if the lock is poisoned we report “not demoted” rather than demoting everything, because a panic in bookkeeping should not silently switch a whole deployment’s routing. The breach will be re-detected on the next resolved outcome.
Sourcepub fn record(
&self,
tenant: &str,
route_ix: usize,
cfg: &Guardrail,
was_correct: bool,
now_secs: i64,
cooldown_secs: i64,
) -> Reaction
pub fn record( &self, tenant: &str, route_ix: usize, cfg: &Guardrail, was_correct: bool, now_secs: i64, cooldown_secs: i64, ) -> Reaction
Record one resolved outcome and react if the window has breached.
was_correct must come from a real downstream result (the feedback API), not from a gate
verdict — otherwise the system grades its own homework.
Trait Implementations§
Source§impl Debug for GuardrailRegistry
impl Debug for GuardrailRegistry
Source§impl Default for GuardrailRegistry
impl Default for GuardrailRegistry
Source§fn default() -> GuardrailRegistry
fn default() -> GuardrailRegistry
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl !Freeze for GuardrailRegistry
impl RefUnwindSafe for GuardrailRegistry
impl Send for GuardrailRegistry
impl Sync for GuardrailRegistry
impl Unpin for GuardrailRegistry
impl UnsafeUnpin for GuardrailRegistry
impl UnwindSafe for GuardrailRegistry
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreCreates a shared type from an unshared type.