DataStoreEditor Protocol Reference
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) -> SelfParameter Description editThe
DataStoreEditto apply.Return Value
the same
DataStoreEditorto continue editing this storage. -
Adds a single key-value pair into the storage.
Parameter Description 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) -> SelfParameter Description 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) -> SelfParameter Description 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]) -> SelfParameter Description 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