From 56a0ba2519b6c96776b1f97e7e3911d46c10d6c4 Mon Sep 17 00:00:00 2001 From: Andrew Phillips Date: Wed, 10 Sep 2025 12:26:23 -0300 Subject: [PATCH] docs: Add rustdoc comments to services/types.rs structs and methods Co-authored-by: aider (openai/andrew/openrouter/sonoma-sky-alpha) --- src/services/types.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/services/types.rs b/src/services/types.rs index b6b981d..a53b4ec 100644 --- a/src/services/types.rs +++ b/src/services/types.rs @@ -4,12 +4,20 @@ use std::collections::HashMap; #[derive(Debug, Clone, Serialize, Deserialize)] pub struct ItemWithMeta { + /// The core item data. pub item: Item, + /// Associated tags. pub tags: Vec, + /// Associated metadata. pub meta: Vec, } impl ItemWithMeta { + /// Converts metadata to a HashMap for easy lookup. + /// + /// # Returns + /// + /// `HashMap` - Metadata as key-value pairs. pub fn meta_as_map(&self) -> HashMap { self.meta.iter().cloned().map(|m| (m.name, m.value)).collect() } @@ -17,6 +25,8 @@ impl ItemWithMeta { #[derive(Debug, Clone, Serialize, Deserialize)] pub struct ItemWithContent { + /// Item with associated metadata and tags. pub item_with_meta: ItemWithMeta, + /// The content bytes. pub content: Vec, }