smart_config_derive/
lib.rs

1//! Procedural macros for `smart-config`.
2//!
3//! All macros in this crate are re-exported from the `smart-config` crate. See its docs for more details
4//! and the examples of usage.
5
6// Documentation settings
7#![doc(html_root_url = "https://docs.rs/smart-config-derive/0.4.0-pre.1")] // x-release-please-version
8// General settings
9#![recursion_limit = "128"]
10
11extern crate proc_macro;
12
13use proc_macro::TokenStream;
14
15mod de;
16mod describe;
17mod example;
18mod utils;
19
20#[proc_macro_derive(DescribeConfig, attributes(config))]
21pub fn describe_config(input: TokenStream) -> TokenStream {
22    describe::impl_describe_config(input)
23}
24
25#[proc_macro_derive(ExampleConfig, attributes(config))]
26pub fn example_config(input: TokenStream) -> TokenStream {
27    example::impl_example_config(input)
28}
29
30#[proc_macro_derive(DeserializeConfig, attributes(config))]
31pub fn deserialize_config(input: TokenStream) -> TokenStream {
32    de::impl_deserialize_config(input)
33}