AtomicDictionary

public final class AtomicDictionary<Key, Value> : @unchecked Sendable where Key : Hashable
extension AtomicDictionary: ExpressibleByDictionaryLiteral
extension AtomicDictionary: Sequence

Note

@unchecked Sendable because value is mutable but every access below is serialized by lock. Key/Value are deliberately unconstrained so existing callers keep working; as before, whether the elements are safe to use across domains remains the caller’s concern.
  • Declaration

    Swift

    public init(initialValue: [Key : Value] = [Key: Value]())
  • Declaration

    Swift

    public var count: Int { get }
  • Declaration

    Swift

    public var keys: [Key] { get }
  • Declaration

    Swift

    public var values: [Value] { get }

Functions