Skip to content

Commit 9cbc3ba

Browse files
committed
Provide more information on the compatible structs for the InfoSection derive.
1 parent 458efc2 commit 9cbc3ba

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

redismodule-rs-macros/src/info_section.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,14 @@ impl SupportedMaps {
2121
/// Generate a [`From`] implementation for this struct so that it is
2222
/// possible to generate a [`redis_module::InfoContext`] information
2323
/// from it.
24+
///
25+
/// A struct is compatible to be used with [`crate::InfoSection`] when
26+
/// it has fields, whose types are convertible to
27+
/// [`redis_module::InfoContextBuilderFieldTopLevelValue`] and (for
28+
/// the dictionaries) if it has fields which are compatible maps of
29+
/// objects, where a key is a [`String`] and a value is any type
30+
/// convertible to
31+
/// [`redis_module::InfoContextBuilderFieldBottomLevelValue`].
2432
fn struct_info_section(struct_name: Ident, struct_data: DataStruct) -> TokenStream {
2533
let fields = match struct_data.fields {
2634
Fields::Named(f) => f,

0 commit comments

Comments
 (0)