Skip to main content

statevec_model/
lib.rs

1// Copyright 2026 Jumpex Technology.
2// SPDX-License-Identifier: Apache-2.0
3
4//! Core schema and wire-model types for StateVec.
5//!
6//! This crate contains the stable schema model shared by domain plugins and
7//! runtime hosts: record layouts, command and event payload definitions,
8//! generated accessor traits, schema registries, schema fingerprints, and IDL
9//! JSON conversion.
10
11/// Schema IDL JSON generation and parsing.
12pub mod idl;
13/// Core record, command, event, field, and accessor model types.
14pub mod model;
15/// Schema registry and stable schema fingerprint calculation.
16pub mod registry;
17#[cfg(test)]
18mod ut_idl;
19#[cfg(test)]
20mod ut_model;
21#[cfg(test)]
22mod ut_registry;
23
24/// Backward-compatible re-export: `statevec_model::record::*` still works.
25pub mod record {
26    pub use crate::model::{
27        AccessError, EnumDecodeError, EnumDefinition, EnumU8, EnumVariantDefinition,
28        FieldDefinition, FieldType, FixedBytes, GeneratedRecordAccess, PkBuilder, PkBytes, PkCodec,
29        PkEncodeFn, RECORD_HEADER_SIZE, RecordDefinition, RecordKey, RecordKind, RecordSchema,
30        SysId, TxSeq, Version, read_bool, read_fixed_bytes, read_i32_le, read_i64_le, read_u8,
31        read_u16_le, read_u32_le, read_u64_le, read_u128_le, write_bool, write_fixed_bytes,
32        write_i32_le, write_i64_le, write_u8, write_u16_le, write_u32_le, write_u64_le,
33        write_u128_le,
34    };
35}
36
37/// Backward-compatible re-export: `statevec_model::command::*` still works.
38pub mod command {
39    pub use crate::model::{
40        Command, CommandDefinition, CommandSchema, GeneratedCommandAccess, PayloadFieldDefinition,
41        Version, read_var_bytes, write_var_bytes,
42    };
43}
44
45/// Backward-compatible re-export: `statevec_model::event::*` still works.
46pub mod event {
47    pub use crate::model::{
48        Event, EventDefinition, EventFrame, EventSchema, GeneratedEventAccess,
49        PayloadFieldDefinition, TxSeq, Version,
50    };
51}
52
53pub use model::*;
54
55/// Stable schema identity and registry types.
56pub use registry::{SchemaFingerprint, SchemaIdentity, SchemaRegistry};