Propagate user app ownership conflict.

This commit is contained in:
2026-10-09 10:16:23 +02:00
parent 51cd5b9bd9
commit 381c229bd4
33 changed files with 779 additions and 138 deletions
+16
View File
@@ -12,6 +12,22 @@ impl<T> Upsert<T> {
}
}
pub enum GuardedUpsert<T> {
Created(T),
Updated(T),
Rejected,
}
impl<T> GuardedUpsert<T> {
pub fn try_map<U, E>(self, f: impl FnOnce(T) -> Result<U, E>) -> Result<GuardedUpsert<U>, E> {
Ok(match self {
Self::Created(value) => GuardedUpsert::Created(f(value)?),
Self::Updated(value) => GuardedUpsert::Updated(f(value)?),
Self::Rejected => GuardedUpsert::Rejected,
})
}
}
pub enum Delete {
Deleted,
NotFound,