Skip to main content

HeuristicsBank

Struct HeuristicsBank 

Source
pub struct HeuristicsBank { /* private fields */ }
Expand description

The heuristics bank: a fixed-size collection of typed degradation motifs.

Version 1.0: 12 entries covering the primary distributed Rust system failure patterns. The bank is finite and versioned — novel patterns produce UnclassifiedStructuralAnomaly.

Implementations§

Source§

impl HeuristicsBank

Source

pub fn default_bank() -> Self

Create a bank with the default Rust distributed-systems entries.

Source

pub fn custom(entries: &'static [HeuristicEntry]) -> Self

Create a bank with custom entries.

Source

pub fn match_sign( &self, sign: &ResidualSign, grammar_state: GrammarState, ) -> MatchResult

Match a residual sign against the bank.

Returns the best-matching heuristic (highest confidence) or UnclassifiedStructuralAnomaly if no entry matches.

Only matches when the grammar state is Boundary or Violation. In Admissible state, returns NoAnomaly.

Source

pub fn match_sign_with_priors( &self, sign: &ResidualSign, grammar_state: GrammarState, priors: &StaticPriorSet, ) -> MatchResult

Match a residual sign against the bank using optional static priors.

Static priors do not force a detection. They only apply bounded threshold scaling to the candidate heuristic they target.

Source

pub fn len(&self) -> usize

Number of entries in the bank.

Source

pub fn is_empty(&self) -> bool

Whether the bank is empty.

Source

pub fn version(&self) -> &'static str

Bank version identifier.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.