ThreadSafeKeyValueStore
Thread-safe dictionary like structure
final class ThreadSafeKeyValueStore<Key, Value> where Key : Hashable
Thread-safe dictionary like structure
final class ThreadSafeKeyValueStore<Key, Value> where Key : Hashable
import Basics
protocol Hashable : Equatable
A type that can be hashed into a Hasher
to produce an integer hash value.
init(_ seed: [Key : Value] = [:])
var count: Int { get }
var isEmpty: Bool { get }
subscript(key: Key) -> Value? { get set }
@discardableResult func clear() -> [Key : Value]
func contains(_ key: Key) -> Bool
func get() -> [Key : Value]
func map<T>(_ transform: ((key: Key, value: Value)) throws -> T) rethrows -> [T]
func mapValues<T>(_ transform: (Value) throws -> T) rethrows -> [Key : T]
@discardableResult func memoize(_ key: Key, body: () throws -> Value) rethrows -> Value
@discardableResult func removeValue(forKey key: Key) -> Value?
protocol Sendable
protocol Copyable
A type whose values can be implicitly or explicitly copied.
protocol Escapable