Crate tirea_state_derive

Crate tirea_state_derive 

Source
Expand description

Derive macro for tirea-state State trait.

This crate provides the #[derive(State)] macro that generates:

  • {Name}Ref<'a>: Typed state reference for reading and writing
  • impl State for {Name}: Trait implementation

§Usage

use tirea_state::State;
use tirea_state_derive::State;

#[derive(State)]
struct User {
    name: String,
    age: i64,
    #[tirea(nested)]
    profile: Profile,
}

Derive Macros§

Lattice
Derive the Lattice trait for a struct with named fields.
State
Derive the State trait for a struct.