pub enum Predicate {
JsonPathEq {
path: String,
value: ScalarValue,
},
JsonPathCompare {
path: String,
op: ComparisonOp,
value: ScalarValue,
},
}Expand description
G4 (Slice 35) — closed typed predicate for Engine::read_list filter.
Exactly two variants per ADR D-F1 ({JsonPathEq, JsonPathCompare}).
The fused variants (JsonPathFused*) and all *_unchecked builders are
explicitly EXCLUDED (ADR D-F2). Use the validated constructors
Predicate::json_path_eq / Predicate::json_path_compare; they
enforce the path allowlist at construction time.
Multiple predicates in Engine::read_list are combined by implicit AND
(D-F5). Compilation target: json_extract(body, '$.field') <op> ? with
a bound parameter (never interpolated — injection-safe per D-F4).
Variants§
JsonPathEq
json_extract(body, path) = ? (equality).
JsonPathCompare
json_extract(body, path) <op> ? (inequality).
Implementations§
Source§impl Predicate
impl Predicate
Sourcepub fn json_path_eq(
path: impl Into<String>,
value: ScalarValue,
) -> Result<Self, EngineError>
pub fn json_path_eq( path: impl Into<String>, value: ScalarValue, ) -> Result<Self, EngineError>
Construct a JsonPathEq predicate with allowlist validation.
Returns EngineError::InvalidFilter if path is not in
[PREDICATE_PATH_ALLOWLIST]; never panics on bad input.
Sourcepub fn json_path_compare(
path: impl Into<String>,
op: ComparisonOp,
value: ScalarValue,
) -> Result<Self, EngineError>
pub fn json_path_compare( path: impl Into<String>, op: ComparisonOp, value: ScalarValue, ) -> Result<Self, EngineError>
Construct a JsonPathCompare predicate with allowlist validation.
Returns EngineError::InvalidFilter if path is not in
[PREDICATE_PATH_ALLOWLIST]; never panics on bad input.