DataStoreEditor
public protocol DataStoreEditor
Enables editing multiple entries in the module storage in a transactional way.
-
Applies a
DataStoreEditto this editor.Declaration
Swift
func apply(edit: DataStoreEdit) -> SelfParameters
editThe
DataStoreEditto apply.Return Value
the same
DataStoreEditorto continue editing this storage. -
Adds a single key-value pair into the storage.
Parameters
keyThe key to store the value under.
valueThe
DataInputto be stored.expiryThe time frame for this data to remain stored.
Return Value
the same
DataStoreEditorto continue editing this storage. -
Adds all key-value pairs from the dictionary into the storage.
Declaration
Swift
func putAll(dataObject: DataObject, expiry: Expiry) -> SelfParameters
dataObjectA
DataObjectcontaining the key-value pairs to be stored.expiryThe time frame for this data to remain stored.
Return Value
the same
DataStoreEditorto continue editing this storage. -
Removes and individual key from storage.
Declaration
Swift
func remove(key: String) -> SelfParameters
keythe key to remove from storage.
Return Value
the same
DataStoreEditorto continue editing this storage. -
Removes multiple keys from storage.
Declaration
Swift
func remove(keys: [String]) -> SelfParameters
keysthe list of keys to remove from storage.
Return Value
the same
DataStoreEditorto continue editing this storage. -
Clears all entries from storage before then adding any key-value pairs.
Declaration
Swift
func clear() -> SelfReturn Value
the same
DataStoreEditorto continue editing this storage. -
Writes the updates to disk in a transaction.
Calling this method multiple times is not supported, and subsequent executions are ignored.
Declaration
Swift
func commit() throws
View on GitHub