pub struct DecisionMemory { /* private fields */ }Implementations§
Source§impl DecisionMemory
impl DecisionMemory
Sourcepub fn open(cfg: DecisionMemoryCfg) -> Self
pub fn open(cfg: DecisionMemoryCfg) -> Self
Open (or initialise) the on-disk log. Returns even if the file doesn’t exist yet – first writes will create it.
pub fn enabled(&self) -> bool
pub fn path(&self) -> &PathBuf
Sourcepub fn record(
&self,
rule_id: &str,
fingerprint: &str,
outcome: Outcome,
tool: &str,
)
pub fn record( &self, rule_id: &str, fingerprint: &str, outcome: Outcome, tool: &str, )
Append a new decision to the log. Errors are logged but never raised – decision memory is best-effort, must not break the proxy if disk is full / RO.
Sourcepub fn verdict_for(&self, fingerprint: &str) -> MemoryVerdict
pub fn verdict_for(&self, fingerprint: &str) -> MemoryVerdict
Consult the log for a given fingerprint and produce a verdict. Reads sequentially; we expect the file to stay small (one entry per high-severity decision per user per project).
Trait Implementations§
Source§impl Clone for DecisionMemory
impl Clone for DecisionMemory
Source§fn clone(&self) -> DecisionMemory
fn clone(&self) -> DecisionMemory
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 moreAuto Trait Implementations§
impl Freeze for DecisionMemory
impl RefUnwindSafe for DecisionMemory
impl Send for DecisionMemory
impl Sync for DecisionMemory
impl Unpin for DecisionMemory
impl UnsafeUnpin for DecisionMemory
impl UnwindSafe for DecisionMemory
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