pub struct PredicateInst {
pub path: FieldPath,
pub op: CompiledOperator,
}Fields§
§path: FieldPath§op: CompiledOperatorImplementations§
Source§impl PredicateInst
impl PredicateInst
Sourcepub fn test(&self, view: &PredicateView<'_>) -> bool
pub fn test(&self, view: &PredicateView<'_>) -> bool
Evaluate the predicate against a phase-typed view. Path-reader →
operator-family dispatch; the matrix of legal (path, op) pairs
is enforced at compile (see Operator::family and
OperatorFamily::accepts). Illegal pairs cannot reach this
function in any compiled FlowGraph; they would have failed
compile_operator. Hand-built PredicateInsts in tests that
supply an unreachable pair fall through to false — sound-by-
default per the spec’s “missing fields miss” contract.
Reads that need an absent piece of state (e.g. tls.sni on a
cleartext connection, http.header.upgrade from an L4 view)
also miss rather than panic.
§Panics
On the http.body arm, the path-reader calls
Body::as_static().expect("lazy-buffer invariant"). The compile
pass marks the incoming edge of every http.body Check with
collect_body_before = Some(BodySide::Request), so by the time
test() runs the executor has already collected the request
body into Body::Static. A Body::Stream / Body::Empty
reaching this arm therefore signals a FlowGraph compile bug and
is surfaced as a clear panic instead of a silent miss. All other
arms are panic-free; absent state misses sound-by-default.
Trait Implementations§
Source§impl Clone for PredicateInst
impl Clone for PredicateInst
Source§fn clone(&self) -> PredicateInst
fn clone(&self) -> PredicateInst
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more