educe/trait_handlers/clone/
mod.rs1mod clone_enum;
2mod clone_struct;
3mod clone_union;
4mod models;
5
6use syn::{Data, DeriveInput, Meta};
7
8use super::TraitHandler;
9use crate::Trait;
10
11pub(crate) struct CloneHandler;
12
13impl TraitHandler for CloneHandler {
14 #[inline]
15 fn trait_meta_handler(
16 ast: &DeriveInput,
17 token_stream: &mut proc_macro2::TokenStream,
18 traits: &[Trait],
19 meta: &Meta,
20 ) -> syn::Result<()> {
21 match ast.data {
22 Data::Struct(_) => clone_struct::CloneStructHandler::trait_meta_handler(
23 ast,
24 token_stream,
25 traits,
26 meta,
27 ),
28 Data::Enum(_) => {
29 clone_enum::CloneEnumHandler::trait_meta_handler(ast, token_stream, traits, meta)
30 },
31 Data::Union(_) => {
32 clone_union::CloneUnionHandler::trait_meta_handler(ast, token_stream, traits, meta)
33 },
34 }
35 }
36}