Expand description
Persistent operation and record metadata shared by independent host libraries.
Register a function marker once, then add disjoint operand signatures from any installer. Ordinary calls and direct member lookup share the same emitters:
use cel_parser::{OpLookup, OperationSignature, ResolvedLeafType};
use cel_runtime::ValueType;
#[derive(Clone)]
struct Identity;
let mut lookup = OpLookup::new();
lookup.register_function("identity", Identity).unwrap();
let ty = ResolvedLeafType::new("u32", ValueType::leaf::<u32>());
lookup.register_operation(OperationSignature {
name: "identity", operands: vec![ty.clone().into()], result: ty.into(),
emit: Box::new(|segment, _| segment.op1(|value: u32| value)),
}).unwrap();
assert_eq!(lookup.operation_signatures("identity").count(), 1);Structs§
- Operation
Signature - Describes one named operation with complete concrete operand and result identities.
- Record
Field - Describes one required record field.
- Record
Schema - Describes a named record’s required fields and construction implementation.
Type Aliases§
- Operation
Emitter - Emits an operation after the complete operand signature has matched.
- Record
Emitter - Consumes source-order fields using source-position to schema-position indices, the ambient stack byte offset, and the expression span.