docs: Add rustdoc comments to services/types.rs structs and methods
Co-authored-by: aider (openai/andrew/openrouter/sonoma-sky-alpha) <aider@aider.chat>
This commit is contained in:
@@ -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<Tag>,
|
||||
/// Associated metadata.
|
||||
pub meta: Vec<Meta>,
|
||||
}
|
||||
|
||||
impl ItemWithMeta {
|
||||
/// Converts metadata to a HashMap for easy lookup.
|
||||
///
|
||||
/// # Returns
|
||||
///
|
||||
/// `HashMap<String, String>` - Metadata as key-value pairs.
|
||||
pub fn meta_as_map(&self) -> HashMap<String, String> {
|
||||
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<u8>,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user