pub trait StoreResultUnitExt<E: StoreErrorPredicates> {
// Required method
fn idempotent(self) -> Result<(), E>;
}Expand description
Extension methods for unit (()) store results, typically produced by write operations.
Required Methods§
Sourcefn idempotent(self) -> Result<(), E>
fn idempotent(self) -> Result<(), E>
Treats a duplicate-write error as success, making the operation idempotent.
Mapping:
Ok(())->Ok(())Err(e)wheree.is_already_exists()->Ok(())- any other
Err(e)->Err(e)
This method does not panic.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".