Propagate user app ownership conflict.
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user