Procedural macros for Ordo rule engine
This crate provides derive macros for generating TypedContext implementations that enable zero-overhead field access in JIT-compiled code.
Usage
use ordo_derive::TypedContext;
#[derive(TypedContext)]
#[repr(C)] // Recommended for stable layout
pub struct LoanContext {
pub amount: f64,
pub credit_score: i32,
pub approved: bool,
}
The macro generates an implementation of TypedContext that provides:
- A static
MessageSchemadescribing the struct layout - Direct field pointer access via
field_ptr() - Nested field path resolution (for nested structs)