Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ import Bytes

typealias DatastoreIndexIdentifier = TypedIdentifier<DiskPersistence<ReadOnly>.Datastore.Index>

@DebugDescription extension DatastoreIndexIdentifier {
var debugDescription: String { "DatastoreIndexIdentifier(\(rawValue))" }
}

extension DiskPersistence.Datastore {
actor Index: Identifiable {
let datastore: DiskPersistence<AccessMode>.Datastore
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ import Foundation

typealias DatastoreIndexManifestIdentifier = DatedIdentifier<DatastoreIndexManifest>

@DebugDescription extension DatastoreIndexManifestIdentifier {
var debugDescription: String { "DatastoreIndexManifestIdentifier(\(rawValue))" }
}

struct DatastoreIndexManifest: Equatable, Identifiable {
/// The identifier for this manifest.
var id: DatastoreIndexManifestIdentifier
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ import Foundation

typealias DatastorePageIdentifier = DatedIdentifier<DiskPersistence<ReadOnly>.Datastore.Page>

@DebugDescription extension DatastorePageIdentifier {
var debugDescription: String { "DatastorePageIdentifier(\(rawValue))" }
}

extension DiskPersistence.Datastore {
actor Page: Identifiable {
let datastore: DiskPersistence<AccessMode>.Datastore
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ import Foundation

typealias DatastoreRootIdentifier = DatedIdentifier<DiskPersistence<ReadOnly>.Datastore.RootObject>

@DebugDescription extension DatastoreRootIdentifier {
var debugDescription: String { "DatastoreRootIdentifier(\(rawValue))" }
}

/// A reference to a particular root within a datastore.
///
/// Prior to version 0.4 (2024-10-11), only the root ID was stored in the snapshot iteration manifest's root file, which meant one would need to guess which datastore it belonged to. This type thus tries to decode both a single ``DatastoreRootIdentifier`` and a pair of ``DatastoreIdentifier`` and ``DatastoreRootIdentifier``s.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ import Foundation

typealias DatastoreIdentifier = TypedIdentifier<DiskPersistence<ReadOnly>.Datastore>

@DebugDescription extension DatastoreIdentifier {
var debugDescription: String { "DatastoreIdentifier(\(rawValue))" }
}

struct WeakValue<T: AnyObject> {
weak var value: T?

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ import QuestionableConcurrency

typealias SnapshotIdentifier = DatedIdentifier<Snapshot<ReadOnly>>

@DebugDescription extension SnapshotIdentifier {
var debugDescription: String { "SnapshotIdentifier(\(rawValue))" }
}

/// A type that manages access to a snapshot on disk.
actor Snapshot<AccessMode: _AccessMode> {
/// The identifier of the snapshot.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ import Foundation

typealias SnapshotIterationIdentifier = DatedIdentifier<SnapshotIteration>

@DebugDescription extension SnapshotIterationIdentifier {
var debugDescription: String { "SnapshotIterationIdentifier(\(rawValue))" }
}

/// Versions supported by ``DiskPersisitence``.
///
/// These are used when dealing with format changes at the library level.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ struct TypedIdentifier<T>: TypedIdentifierProtocol {
}
}

protocol TypedIdentifierProtocol: RawRepresentable, Codable, Equatable, Hashable, CustomStringConvertible, Comparable, Sendable {
protocol TypedIdentifierProtocol: RawRepresentable, Codable, Equatable, Hashable, CustomStringConvertible, CustomDebugStringConvertible, Comparable, Sendable {
var rawValue: String { get }
init(rawValue: String)
}
Expand All @@ -34,6 +34,7 @@ extension TypedIdentifierProtocol {
}

var description: String { rawValue }
var debugDescription: String { "\(Self.self)(\(rawValue))" }
}

extension TypedIdentifierProtocol {
Expand Down