KVStorageProtocol
public protocol KVStorageProtocol
A simple namespace-key-value storage protocol to stashing and retrieving Data blobs.
-
set(ns:key:value:)Default implementationSets the
Datavalue for a key in a namespace.Default Implementation
Derived extension to set a
Numericvalue for a key in a namespace.Derived extension to set a
ToFromDatavalue for a key in a namespace.Declaration
Swift
func set(ns: CustomStringConvertible, key: CustomStringConvertible, value: Data) -
get(ns:key:)Default implementationGets the
Datavalue for a key in a namespace.Default Implementation
Derived extension to get a
Numericvalue for a key in a namespace.Derived extension to get a
ToFromDatavalue for a key in a namespace.Declaration
Swift
func get(ns: CustomStringConvertible, key: CustomStringConvertible) -> Data? -
Removes a key from a namespace.
Declaration
Swift
func remove(ns: CustomStringConvertible, key: CustomStringConvertible) -
Tests whether a namespace has a key.
Declaration
Swift
func has(ns: CustomStringConvertible, key: CustomStringConvertible) -> Bool -
Gets all keys in a namespace.
Declaration
Swift
func keys(ns: CustomStringConvertible) -> [String]
-
defaultNamespaceExtension methodThe
default namespace
we use to ergonomically stash a handful of global things.Declaration
Swift
var defaultNamespace: String { get } -
set(_:_:)Extension methodDerived method to set a
Datavalue for a key in the default namespace.Declaration
Swift
func set(_ key: CustomStringConvertible, _ value: Data) -
get(_:)Extension methodDerived method to get a
Datavalue for a key in the default namespace.Declaration
Swift
func get(_ key: CustomStringConvertible) -> Data? -
remove(_:)Extension methodDerived method to remove a key in the default namespace.
Declaration
Swift
func remove(_ key: CustomStringConvertible) -
set(_:_:)Extension methodDerived method to set a
Numericvalue for a key in the default namespace.Declaration
Swift
func set<T>(_ key: CustomStringConvertible, _ value: T) where T : Numeric -
get(_:)Extension methodDerived method to get a
Numericvalue for a key in the default namespace.Declaration
Swift
func get<T>(_ key: CustomStringConvertible) -> T? where T : Numeric -
set(_:_:)Extension methodDerived method to set a
ToFromDatavalue for a key in the default namespace.Declaration
Swift
func set<T>(_ key: CustomStringConvertible, _ value: T) where T : ToFromData -
get(_:)Extension methodDerived method to get a
ToFromDatavalue for a key in the default namespace.Declaration
Swift
func get<T>(_ key: CustomStringConvertible) -> T? where T : ToFromData
View on GitHub
Install in Dash
KVStorageProtocol Protocol Reference