ThreadsafeDict
public class ThreadsafeDict<Key, Value> where Key : Hashable
extension ThreadsafeDict: Encodable where Key: Encodable, Value: Encodable
extension ThreadsafeDict: Decodable where Key: Decodable, Value: Decodable
Threadsafe Dictionary using reader/writer pattern Codeable/Decodable if the contained types are
-
Init
Declaration
Swift
public init(_ newDict: [Key : Value])Parameters
newDictinitial dictionary
-
if key/value are decodable, provide decodable initialiser
Declaration
Swift
required public init(from decoder: Decoder) throws where Key: Decodable, Value: Decodable -
Returns regular dict
Declaration
Swift
public var unsafeContents: [Key : Value] { get } -
Undocumented
Declaration
Swift
public subscript(index: Key) -> Value? { get set } -
Remove Value
Declaration
Swift
public func removeValue(forKey key: Key)Parameters
keykey
-
Keys
Declaration
Swift
public var keys: Dictionary<Key, Value>.Keys { get }
-
Declaration
Swift
public func encode(to encoder: Encoder) throws
ThreadsafeDict Class Reference