zino-derive 0.26.0

Derived traits for zino.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use proc_macro2::TokenStream;
use quote::quote;
use syn::DeriveInput;

/// Parses the token stream for the `ModelHooks` trait derivation.
pub(super) fn parse_token_stream(input: DeriveInput) -> TokenStream {
    // Model name
    let name = input.ident;

    quote! {
        impl zino_core::model::ModelHooks for #name {
            type Data = ();
            type Extension = ();
        }
    }
}