cronback_dto_derive/
lib.rs1use proc_macro::TokenStream;
2use syn::{parse_macro_input, DeriveInput};
3
4#[proc_macro_derive(IntoProto, attributes(proto, into_proto))]
5pub fn derive_into_proto(input: TokenStream) -> TokenStream {
6 let input = parse_macro_input!(input as DeriveInput);
7 dto_core::derive_into_proto(input).into()
8}
9
10#[proc_macro_derive(FromProto, attributes(proto, from_proto))]
11pub fn derive_from_proto(input: TokenStream) -> TokenStream {
12 let input = parse_macro_input!(input as DeriveInput);
13 dto_core::derive_from_proto(input).into()
14}
15
16#[proc_macro_derive(ProstMessageExt, attributes(prost))]
17pub fn derive_prost_message_ext(input: TokenStream) -> TokenStream {
18 let input = parse_macro_input!(input as DeriveInput);
19 dto_core::derive_prost_message_ext(input).into()
20}