| Crates.io | justcode-derive |
| lib.rs | justcode-derive |
| version | 0.3.0 |
| created_at | 2025-11-06 08:26:31.666171+00 |
| updated_at | 2025-11-07 05:59:09.963584+00 |
| description | Derive macros for justcode |
| homepage | https://github.com/entropy-tamer/justcode |
| repository | https://github.com/entropy-tamer/justcode |
| max_upload_size | |
| id | 1919287 |
| size | 13,843 |
Derive macros for the justcode binary encoder/decoder library.
This crate provides procedural macros to automatically implement the Encode and Decode traits from justcode-core for your custom types.
This crate is typically used as a dependency of justcode-core when the derive feature is enabled:
[dependencies]
justcode-core = { version = "0.3.0", features = ["derive"] }
You generally don't need to add justcode-derive directly to your Cargo.toml unless you're implementing custom derive macros.
Use the #[derive(Encode, Decode)] attribute on your structs and enums:
use justcode_core::{Encode, Decode};
#[derive(Encode, Decode)]
struct Point {
x: f32,
y: f32,
}
#[derive(Encode, Decode)]
enum Shape {
Circle { center: Point, radius: f32 },
Rectangle { top_left: Point, bottom_right: Point },
}
The derive macros support:
MIT