Skip to main content

apply_contract

Function apply_contract 

Source
pub fn apply_contract(
    records: Vec<Value>,
    contract: &CompiledContract,
) -> Result<ContractOutcome, FaucetError>
Available on crate feature contract only.
Expand description

Apply the contract to one page. Pure: no metrics, no DLQ I/O.

Records are evaluated in order; per record, the first breach wins (fields in declared order, then the extra-field check). Policy:

  • fail — return FaucetError::ContractViolation on the first breach.
  • quarantine — move breaching records to quarantined.
  • warn — record the breach in warned, keep the record in survivors.