From 56abafc94d5992c75ff2b1d965a12dc78f1224ec Mon Sep 17 00:00:00 2001 From: Max Audron Date: Tue, 30 Nov 2021 18:43:47 +0100 Subject: add default and skip properties to Network derive macros --- derive/src/network/mod.rs | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'derive/src/network/mod.rs') diff --git a/derive/src/network/mod.rs b/derive/src/network/mod.rs index 61af9c4..61338e5 100644 --- a/derive/src/network/mod.rs +++ b/derive/src/network/mod.rs @@ -57,6 +57,13 @@ pub struct NetworkField { /// network representation for this field #[darling(default)] map: bool, + /// Skips this field when parsing from network + /// representation and uses the default value of the type + #[darling(default)] + default: bool, + /// Skips this field when serializing to network representation + #[darling(default)] + skip: bool, } fn parse_fields(input: &syn::DeriveInput) -> Vec { -- cgit v1.2.3