aboutsummaryrefslogtreecommitdiff
path: root/derive/src/lib.rs
diff options
context:
space:
mode:
authorMax Audron <audron@cocaine.farm>2021-09-28 18:03:58 +0200
committerMax Audron <audron@cocaine.farm>2021-09-28 18:15:50 +0200
commitd484216aadff7d4a7ba5af429efe6252abf5c8ed (patch)
tree4fe1cc84525cb9b97b4198f5543be70c89d9775c /derive/src/lib.rs
parentadd statetracker to workspace (diff)
add NetworkList and NetworkMap derive macros
this is an ongoing effort to generalize the parsing/serialization. With this NetworkList and NetworkMap can be used both at the same time to allow the de-/serialization of objects into both formats
Diffstat (limited to 'derive/src/lib.rs')
-rw-r--r--derive/src/lib.rs10
1 files changed, 10 insertions, 0 deletions
diff --git a/derive/src/lib.rs b/derive/src/lib.rs
index 831767a..1b95091 100644
--- a/derive/src/lib.rs
+++ b/derive/src/lib.rs
@@ -8,6 +8,16 @@ pub fn network(input: proc_macro::TokenStream) -> proc_macro::TokenStream {
network::network(input)
}
+#[proc_macro_derive(NetworkList, attributes(network))]
+pub fn network_list(input: proc_macro::TokenStream) -> proc_macro::TokenStream {
+ network::network_list(input)
+}
+
+#[proc_macro_derive(NetworkMap, attributes(network))]
+pub fn network_map(input: proc_macro::TokenStream) -> proc_macro::TokenStream {
+ network::network_map(input)
+}
+
#[proc_macro_derive(From, attributes(from))]
pub fn from(input: proc_macro::TokenStream) -> proc_macro::TokenStream {
from::from(input)