DataStoring
public protocol DataStoring
DataStoring API The implementer has to store Data associated with the given key.
-
Puts the data to the store with the given key
Declaration
Swift
func put(data: Data, for key: String) throws
Parameters
data
a Data type to store as a value
key
a String type, which will be the key in the store
-
Loads the data for the given key from the datastore
Declaration
Swift
func data(for key: String) throws -> Data?
Parameters
key
a String type, which is the key in the store for the value
Return Value
the Data from store for the given key or nil if the key does not exists
-
Removes the key/value pair from the store for the given key
Declaration
Swift
func removeData(for key: String) throws
Parameters
key
a String type
-
Returns the keys which are currently in the datastore
Declaration
Swift
func keys() throws -> Set<String>
Return Value
a Set of Strings containing the existing keys in the store