Expose derive macro behind feature

This commit is contained in:
2026-06-26 00:59:39 +09:00
parent b8404df047
commit ada3578a1d
6 changed files with 12 additions and 10 deletions
+2 -3
View File
@@ -89,15 +89,14 @@ This matches the runtime model used for Decodal source-defined schema objects.
## Typed Rust integration
Hosts can use `decodal-derive` to keep a Rust struct, the Decodal schema, and the decoded result in sync.
Hosts can enable the `derive` feature on `decodal` to keep a Rust struct, the Decodal schema, and the decoded result in sync.
The derive implements two traits from the `decodal` crate:
- `DecodalSchema`: builds a `HostValue` schema that can be passed to `Engine::bind_global`.
- `DecodalDecode`: decodes materialized `Data` back into the Rust type.
```rust
use decodal::{DecodalDecode, DecodalSchema, EmptyLoader, Engine};
use decodal_derive::Decodal;
use decodal::{Decodal, DecodalDecode, DecodalSchema, EmptyLoader, Engine};
#[derive(Decodal)]
struct Service {