Files
swift-collections/Sources/PersistentCollections/_DictionaryNodeProtocol.swift
T
Karoy Lorentey 14f90620c8 [PersistentCollections] Introduce _Bucket, _Bitmap, _HashPath, and _HashValue
These provide nicer tools for slicing up hash values and dealing with node bitmaps.

_Bucket is a logical entry in the hash table inside a node.
_Bitmap is a set of bucket values, represented by a bitset.
_HashPath facilitates slicing up a hash value into a series of bucket values.
_HashValue represents a hash value.

This is still just mostly superficial refactoring, with little to no functional changes.
2022-09-09 00:47:10 -07:00

41 lines
1.1 KiB
Swift

//===----------------------------------------------------------------------===//
//
// This source file is part of the Swift Collections open source project
//
// Copyright (c) 2019 - 2022 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See https://swift.org/LICENSE.txt for license information
//
//===----------------------------------------------------------------------===//
// FIXME: Remove
internal protocol _DictionaryNodeProtocol: _NodeProtocol
where Element == (key: Key, value: Value)
{
associatedtype Key: Hashable
associatedtype Value
func get(_ key: Key, _ path: _HashPath) -> Value?
func containsKey(_ key: Key, _ path: _HashPath) -> Bool
func index(
forKey key: Key, _ path: _HashPath, _ skippedBefore: Int
) -> PersistentDictionary<Key, Value>.Index?
func updateOrUpdating(
_ isUnique: Bool,
_ item: Element,
_ path: _HashPath,
_ effect: inout _DictionaryEffect<Value>
) -> Self
func removeOrRemoving(
_ isStorageKnownUniquelyReferenced: Bool,
_ key: Key,
_ path: _HashPath,
_ effect: inout _DictionaryEffect<Value>
) -> Self
}