Skip to main content

WaiverSet

Struct WaiverSet 

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

The loaded waiver set: gate-side matching + doctor-side lint.

Implementations§

Source§

impl WaiverSet

Source

pub fn load(path: &Path) -> Result<Self, WaiverError>

Loads the waiver file; a missing file is an empty set (waivers are optional), any other failure is loud.

§Errors

Returns WaiverError on unreadable or malformed content.

Source

pub fn append(path: &Path, waiver: Waiver) -> Result<Waiver, WaiverError>

Appends one record to the waiver file (creating file and parent dir as needed) and returns the stored entry.

§Errors

Returns WaiverError on read, parse, or write failure.

Source

pub fn entries(&self) -> &[Waiver]

Source

pub fn suppresses(&self, rule: &str, file: &str, now: OffsetDateTime) -> bool

True when an unexpired, unsuperseded waiver covers rule on file. The protected-path rule is never waivable — the harness cannot be negotiated with (integration doc §11). Matching normalizes legacy-prefixed rule ids so a waiver granted pre-rename still covers its rule (remediation pass 3, PART B2).

Source

pub fn apply_now(&self, result: CheckResult) -> CheckResult

apply at the current instant — the gate’s call site.

Source

pub fn apply(&self, result: CheckResult, now: OffsetDateTime) -> CheckResult

Drops waived violations from a gate result, recomputing the decision.

Source

pub fn lint_now(&self) -> Vec<String>

lint at the current instant — doctor’s call site.

Source

pub fn active_now(&self) -> Vec<&Waiver>

active at the current instant — report/statusline call site.

Source

pub fn active(&self, now: OffsetDateTime) -> Vec<&Waiver>

Waivers currently in force: unexpired and unsuperseded.

Source

pub fn lint(&self, now: OffsetDateTime) -> Vec<String>

Stale-entry lint findings for doctor (spec §15: “stale-entry lint”). Expired and superseded entries are stale; contradiction links are surfaced as informational pairs for the human to resolve.

Trait Implementations§

Source§

impl Debug for WaiverSet

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for WaiverSet

Source§

fn default() -> WaiverSet

Returns the “default value” for a type. Read more

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, 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.