Skip to content

Commit

Permalink
Provide more information on the compatible structs for the InfoSectio…
Browse files Browse the repository at this point in the history
…n derive.
  • Loading branch information
iddm committed Jul 17, 2023
1 parent 458efc2 commit 9cbc3ba
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions redismodule-rs-macros/src/info_section.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 9cbc3ba

Please sign in to comment.