From dcffe956fd5c46a3a7837f7f408fb61ca36e4741 Mon Sep 17 00:00:00 2001 From: davidemazzocchi Date: Tue, 11 Nov 2025 11:00:27 +0100 Subject: [PATCH] doc: update documentation of catalog.get --- 01.workspace/heave/src/imp/catalog_get.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/01.workspace/heave/src/imp/catalog_get.rs b/01.workspace/heave/src/imp/catalog_get.rs index ac7841a..641798b 100644 --- a/01.workspace/heave/src/imp/catalog_get.rs +++ b/01.workspace/heave/src/imp/catalog_get.rs @@ -14,9 +14,16 @@ impl Catalog { /// /// An `Option` containing the converted entity if found in the in-memory /// cache, otherwise `None`. + /// + /// # Errors + /// + /// Returns `Err(FailedTo::ConvertEntity)` if the retrieved entity cannot be + /// converted into the specified type `T`. This typically happens if the + /// entity's data structure in the catalog does not match the expected + /// structure of `T`. pub fn get(&self, id: &str) -> Result, FailedTo> where - T: EAV, + T: EAV, // T must implement the EAV trait to allow conversion from an Entity { self.with_items(|items| { let entity = items.get(id);