doc: update documentation of catalog.upsert

This commit is contained in:
2025-11-11 11:16:14 +01:00
parent 8a23cfc34d
commit 44f548562b

View File

@@ -18,6 +18,12 @@ impl Catalog {
/// # Arguments /// # Arguments
/// ///
/// * `object` - The object to insert or update, which must implement the `EAV` trait. /// * `object` - The object to insert or update, which must implement the `EAV` trait.
///
/// # Errors
///
/// Returns `Err(FailedTo::ConvertObject)` if the provided `object` cannot be
/// converted into an `Entity`. This typically indicates an issue with the
/// object's structure or missing required fields for entity conversion.
pub fn upsert(&self, object: impl EAV) -> Result<(), FailedTo> { pub fn upsert(&self, object: impl EAV) -> Result<(), FailedTo> {
let mut entity = object.try_into().map_err(|_| FailedTo::ConvertObject)?; let mut entity = object.try_into().map_err(|_| FailedTo::ConvertObject)?;
self.on_items(|items| { self.on_items(|items| {