educe/trait_handlers/debug/
mod.rs

1mod common;
2mod debug_enum;
3mod debug_struct;
4mod debug_union;
5mod models;
6mod panic;
7
8use syn::{Data, DeriveInput, Meta};
9
10use super::TraitHandler;
11use crate::Trait;
12
13pub(crate) struct DebugHandler;
14
15impl TraitHandler for DebugHandler {
16    #[inline]
17    fn trait_meta_handler(
18        ast: &DeriveInput,
19        token_stream: &mut proc_macro2::TokenStream,
20        traits: &[Trait],
21        meta: &Meta,
22    ) -> syn::Result<()> {
23        match ast.data {
24            Data::Struct(_) => debug_struct::DebugStructHandler::trait_meta_handler(
25                ast,
26                token_stream,
27                traits,
28                meta,
29            ),
30            Data::Enum(_) => {
31                debug_enum::DebugEnumHandler::trait_meta_handler(ast, token_stream, traits, meta)
32            },
33            Data::Union(_) => {
34                debug_union::DebugUnionHandler::trait_meta_handler(ast, token_stream, traits, meta)
35            },
36        }
37    }
38}