Expand description
native_model
is a Rust crate that acts as a thin wrapper around serialized data, adding identity and version information.
- It aims to ensure:
- Interoperability: Different applications can work together even if they use different data model versions.
- Data Consistency: Ensures the data is processed as expected.
- Flexibility: Allows the use of any serialization format. Mode details here.
- Minimal Performance Overhead: Current performance has a minimal overhead see performance section.
- Suitability:
- Suitable for applications that are written in Rust, evolve independently, store data locally, and require incremental upgrades.
- Not suitable for non-Rust applications, systems not controlled by the user, or when human-readable formats are needed.
- Setup:
- Users must define their own serialization format and data model. Mode details here.
- Development Stage:
- The crate is in early development, and performance is expected to improve over time.
See examples in the README.md file.
Modules§
- bincode_
1_ 3 - bincode 1.3 · The default codec for serializing & deserializing.
- bincode_
2_ rc - bincode 2.0.0-rc.3 ·
Enable the
bincode_2_rc
feature and annotate your type withnative_model::bincode_2_rc::Bincode
to havenative_db
use this crate for serializing & deserializing. - postcard_
1_ 0 - postcard 1.0 ·
Enable the
postcard_1_0
feature and annotate your type withnative_model::postcard_1_0::PostCard
to havenative_db
use this crate. - rmp_
serde_ 1_ 3 - rmp-serde 1.3 ·
Enable the
rmp_serde_1_3
feature andannotate your type
withnative_model::rmp_serde_1_3::RmpSerde
ornative_model::rmp_serde_1_3::RmpSerdeNamed
to havenative_db
use this crate. - wrapper
Structs§
Enums§
Traits§
- Decode
- Decode trait for your own decoding method.
- Encode
- Encode trait for your own encoding method.
- Model
Functions§
- decode
- Allows to decode a
native_model
from aVec<u8>
and returns the version (u32
). See examples: - encode
- Allows to encode a
native_model
into aVec<u8>
. - encode_
downgrade - Allows to encode a
native_model
into aVec<u8>
with a specific version. See examples:
Type Aliases§
Attribute Macros§
- native_
model - Macro which add identity and version to your rust type.