educe/trait_handlers/partial_eq/
mod.rs

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