Files
swift-custom-dump/Sources/CustomDump/DebugSnapshotRepresentable.swift
2026-02-07 12:44:54 -08:00

17 lines
490 B
Swift

public protocol DebugSnapshotRepresentable<DebugSnapshot> {
associatedtype DebugSnapshot
var _debugSnapshot: DebugSnapshot { get }
}
extension Optional: DebugSnapshotRepresentable where Wrapped: DebugSnapshotRepresentable {
public var _debugSnapshot: Wrapped.DebugSnapshot? {
self?._debugSnapshot
}
}
extension Array: DebugSnapshotRepresentable where Element: DebugSnapshotRepresentable {
public var _debugSnapshot: [Element.DebugSnapshot] {
map(\._debugSnapshot)
}
}