Parcode Derive
This crate provides the #[derive(ParcodeObject)] procedural macro for the Parcode library.
Note: You likely do not need to add this crate directly to your
Cargo.toml. Instead, use theparcodecrate which re-exports this macro.
Usage
Deriving ParcodeObject on a struct automatically implements:
- Serialization Logic: Optimized, parallel-ready serialization.
- Lazy Mirroring: Generates a shadow struct (e.g.,
MyStructLazy) for zero-copy field access.
use ParcodeObject;
use ;
Attributes
#[parcode(chunkable)]: Marks a field (usually aVecor nested Struct) to be stored in its own graph node. This enables lazy loading and parallel writing for this field.#[parcode(map)]: Activates "Hash Sharding" forHashMaptypes. This splits the map into buckets and builds micro-indexes, allowing $O(1)$ lookup without deserializing the whole map.#[parcode(compression = "...")]: Overrides the compression algorithm for this specific field. Supported values:"none","lz4".
License
This project is licensed under the MIT license.