# zwire-derive

> Procedural macro crate providing #[derive(ReactiveStore)] and typed wire conversions for zwire.

Enable the `derive` feature on `zwire-protocol` to derive `WireCodec` for concrete named-field structs. Every field must implement `WireCodec`. Generic structs, tuple structs and enums can implement the trait directly. The macro forwards field conversion to each field's codec, including the lossless integer encoding. Unknown incoming object fields are ignored. All declared fields, including nullable fields, must be present.

```rust
use zwire_protocol::{WireCodec, WireValue};

#[derive(WireCodec)]
struct Account { sequence: u64, active: bool }

let account = Account { sequence: u64::MAX, active: true };
let decoded = Account::from_wire(&account.to_wire())?;
```

The macro expands through `::zwire_protocol` by default. Facade users can select the re-export with `#[wire(crate = zwire::protocol)]`, including when the protocol dependency has been renamed.
