Skip to content

Latest commit

 

History

History
40 lines (27 loc) · 1.15 KB

File metadata and controls

40 lines (27 loc) · 1.15 KB

Rust Python Bindings

The Rust bindings are optional. They expose selected event-core primitives to Python without making the main project depend on the compiled extension.

What is exposed

  • engine_name()
  • roundtrip_event_envelope_json(...)
  • normalize_event_log_jsonl(...)
  • event_log_entry_count(...)
  • load_event_log_envelopes_jsonl(...)

The Python wrapper lives in python/apex_engine/integrations/rust_core.py. The wrapper also exposes load_event_envelopes(path) for typed Python-side event loading.

Build

Install maturin if it is not already available:

./.venv311/bin/pip install maturin

Build the extension into the active Python environment:

PATH="$HOME/.cargo/bin:$PATH" PYO3_USE_ABI3_FORWARD_COMPATIBILITY=1 maturin develop -m rust/apex-py/Cargo.toml

Test

./.venv311/bin/python -m pytest tests/python/test_rust_integration.py

Limitations

  • The binding is optional and may be skipped if not built.
  • It currently focuses on deterministic serialization, direct event-envelope loading, and event-log replay helpers.
  • It does not replace the Rust event bus or the Python backtest engine.