Macro state

Source
macro_rules! state {
    (
        $state_type:ident,
        models: [$(
            $model_type:ident
        ),*] $(,)?
    ) => { ... };
}
Expand description

A macro to define a state struct that holds relations of models.

ยงExample





joydb::state! {
   AppState,
   models: [User, Post],
}

Where User and Post are models that implement the Model trait.