From 7d4d91d2bf8dfd2287e325be35df855467a9abed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wojciech=20Przytu=C5=82a?= Date: Wed, 13 Nov 2024 21:31:50 +0100 Subject: [PATCH] macros: add missing comments to Serialize* attrs Some comments were missing, so I imported them from DeserializeValue. --- scylla-macros/src/serialize/row.rs | 8 ++++++++ scylla-macros/src/serialize/value.rs | 8 ++++++++ 2 files changed, 16 insertions(+) diff --git a/scylla-macros/src/serialize/row.rs b/scylla-macros/src/serialize/row.rs index 9e4a991f6..a5449c9be 100644 --- a/scylla-macros/src/serialize/row.rs +++ b/scylla-macros/src/serialize/row.rs @@ -16,6 +16,10 @@ struct Attributes { #[darling(default)] flavor: Flavor, + // If true, then the type checking code won't verify the column names. + // Columns will be matched to struct fields based solely on the order. + // + // This annotation only works if `enforce_order` flavor is specified. #[darling(default)] skip_name_checks: bool, } @@ -47,8 +51,12 @@ impl Field { #[derive(FromAttributes)] #[darling(attributes(scylla))] struct FieldAttributes { + // If set, then serializes from the column with this particular name + // instead of the Rust field name. rename: Option, + // If true, then the field is not serialized at all, but simply ignored. + // All other attributes are ignored. #[darling(default)] skip: bool, } diff --git a/scylla-macros/src/serialize/value.rs b/scylla-macros/src/serialize/value.rs index f93fc90b9..c1d8bb45c 100644 --- a/scylla-macros/src/serialize/value.rs +++ b/scylla-macros/src/serialize/value.rs @@ -16,6 +16,10 @@ struct Attributes { #[darling(default)] flavor: Flavor, + // If true, then the type checking code won't verify the UDT field names. + // UDT fields will be matched to struct fields based solely on the order. + // + // This annotation only works if `enforce_order` flavor is specified. #[darling(default)] skip_name_checks: bool, @@ -62,8 +66,12 @@ impl Field { #[derive(FromAttributes)] #[darling(attributes(scylla))] struct FieldAttributes { + // If set, then serializes from the UDT field with this particular name + // instead of the Rust field name. rename: Option, + // If true, then the field is not serialized at all, but simply ignored. + // All other attributes are ignored. #[darling(default)] skip: bool,