Skip to main content

GraphState

Derive Macro GraphState 

Source
#[derive(GraphState)]
{
    // Attributes available to this derive:
    #[reducer]
    #[graph_state]
}
Expand description

Derive macro — generates impl GraphState for <T> with per-field reducers. The derive name shadows the trait name; both are imported via use cognis_graph::GraphState; because Rust allows a trait and a derive macro to share the same identifier (they live in different namespaces). #[derive(GraphStateV2)] — v2-shape state derive that emits a typed sibling <Name>Update struct and an impl GraphState for <Name>. Use in v2 code via the re-export cognis_core::GraphState (the rename happens in cognis-core’s lib.rs in Plan #2).