OCSF Types for Rust
Strongly typed Rust structs for the OCSF
This crate provides native Rust types for OCSF events, objects, and enums. It is generated programmatically from the official OCSF schema. It uses the official python OCSF compile tool to first create a flattened JSON schema then use serde to parse it.
Usage
Add this to your Cargo.toml:
[]
= "0.1.0"
Example
Here is how you may use this package:
use AccountChange;
let mut event = default;
event.activity_id = 1;
event.class_uid = 1001;
event.message = Some;
Development
If you are interested in building this from scratch or contributing.
Requirements
- git
- rust
- python ^3.13 with ocsf-lib
Building
Note - if generate.rs is failing, make sure there exists a src/ocsf_generated.rs file