mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-24 10:11:08 +00:00
Add try_mutate_exists to StorageDoubleMap. (#6694)
This commit is contained in:
@@ -366,6 +366,13 @@ pub trait StorageDoubleMap<K1: FullEncode, K2: FullEncode, V: FullCodec> {
|
||||
KArg2: EncodeLike<K2>,
|
||||
F: FnOnce(&mut Self::Query) -> Result<R, E>;
|
||||
|
||||
/// Mutate the item, only if an `Ok` value is returned. Deletes the item if mutated to a `None`.
|
||||
fn try_mutate_exists<KArg1, KArg2, R, E, F>(k1: KArg1, k2: KArg2, f: F) -> Result<R, E>
|
||||
where
|
||||
KArg1: EncodeLike<K1>,
|
||||
KArg2: EncodeLike<K2>,
|
||||
F: FnOnce(&mut Option<V>) -> Result<R, E>;
|
||||
|
||||
/// Append the given item to the value in the storage.
|
||||
///
|
||||
/// `V` is required to implement [`StorageAppend`].
|
||||
|
||||
Reference in New Issue
Block a user