mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-28 07:27:55 +00:00
mutate_exists for StorageValue with ValueQuery (#13245)
* mutate_exists for StorageValue with ValueQuery Signed-off-by: muraca <mmuraca247@gmail.com> * added `#[crate::storage_alias]` to tests Signed-off-by: muraca <mmuraca247@gmail.com> * added StorageEntryMetadata Signed-off-by: muraca <mmuraca247@gmail.com> * Update frame/support/src/lib.rs --------- Signed-off-by: muraca <mmuraca247@gmail.com> Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
This commit is contained in:
@@ -114,6 +114,12 @@ pub trait StorageValue<T: FullCodec> {
|
||||
/// Mutate the value if closure returns `Ok`
|
||||
fn try_mutate<R, E, F: FnOnce(&mut Self::Query) -> Result<R, E>>(f: F) -> Result<R, E>;
|
||||
|
||||
/// Mutate the value. Deletes the item if mutated to a `None`.
|
||||
fn mutate_exists<R, F: FnOnce(&mut Option<T>) -> R>(f: F) -> R;
|
||||
|
||||
/// Mutate the value if closure returns `Ok`. Deletes the item if mutated to a `None`.
|
||||
fn try_mutate_exists<R, E, F: FnOnce(&mut Option<T>) -> Result<R, E>>(f: F) -> Result<R, E>;
|
||||
|
||||
/// Clear the storage value.
|
||||
fn kill();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user