#[unsafe(no_mangle)]pub unsafe extern "C" fn net_predicate_evaluate(
predicate_json: *const c_char,
tags_json: *const c_char,
metadata_json: *const c_char,
) -> c_intExpand description
Evaluate a wire-format Predicate against a (tags, metadata)
context. Mirrors Predicate::evaluate_unplanned(ctx) from the
substrate.
All three inputs MUST be NUL-terminated UTF-8 JSON strings.
Return values:
1— predicate evaluated totrue.0— predicate evaluated tofalse.NetError::NullPointer(negative) — any of the three pointers is NULL.NetError::InvalidUtf8(negative) — input bytes aren’t valid UTF-8.NetError::InvalidJson(negative) — failed to parse thepredicate_jsonas aPredicateWire, thetags_jsonas aVec<String>, themetadata_jsonas an object, OR any tag string failed to parse.
Stateless. Thread-safe. The substrate’s evaluator visits the predicate AST in declaration order without planner reordering; boolean results are invariant under planning, so callers that want planned evaluation can call this and trust the answer.
§Safety
predicate_json, tags_json, and metadata_json MUST point
at NUL-terminated UTF-8 strings valid for the duration of the
call. The buffers are not retained after return.