From 9cbc3ba75ec3d954b9d4130d50920bffc3fd0a21 Mon Sep 17 00:00:00 2001 From: Victor Polevoy Date: Mon, 17 Jul 2023 17:48:13 +0200 Subject: [PATCH] Provide more information on the compatible structs for the InfoSection derive. --- redismodule-rs-macros/src/info_section.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/redismodule-rs-macros/src/info_section.rs b/redismodule-rs-macros/src/info_section.rs index 5b59f668..a6af0935 100644 --- a/redismodule-rs-macros/src/info_section.rs +++ b/redismodule-rs-macros/src/info_section.rs @@ -21,6 +21,14 @@ impl SupportedMaps { /// Generate a [`From`] implementation for this struct so that it is /// possible to generate a [`redis_module::InfoContext`] information /// from it. +/// +/// A struct is compatible to be used with [`crate::InfoSection`] when +/// it has fields, whose types are convertible to +/// [`redis_module::InfoContextBuilderFieldTopLevelValue`] and (for +/// the dictionaries) if it has fields which are compatible maps of +/// objects, where a key is a [`String`] and a value is any type +/// convertible to +/// [`redis_module::InfoContextBuilderFieldBottomLevelValue`]. fn struct_info_section(struct_name: Ident, struct_data: DataStruct) -> TokenStream { let fields = match struct_data.fields { Fields::Named(f) => f,