DiagnosticSet
public struct DiagnosticSet : Error, Sendable
extension DiagnosticSet: ExpressibleByArrayLiteral
extension DiagnosticSet: CustomStringConvertible
extension DiagnosticSet: Equatable
A set of Diagnostic that can answer the question “was there an error?” in O(1).
-
The elements of
self.Declaration
Swift
public private(set) var elements: Set<Diagnostic> { get } -
Whether an error was reported.
Declaration
Swift
public private(set) var containsError: Bool { get } -
Creates an empty instance.
Declaration
Swift
public init() -
Creates an instance containing the elements of
batch.Declaration
Swift
public init<B>(_ batch: B) where B : Collection, B.Element == Diagnostic -
Inserts
dintoself, returningtrueiffdwas not already present.Declaration
Swift
@discardableResult public mutating func insert(_ d: Diagnostic) -> Bool -
Inserts the elements of
batch.Declaration
Swift
public mutating func formUnion<B>(_ batch: B) where B : Sequence, B.Element == Diagnostic -
Inserts the elements of
other.Declaration
Swift
public mutating func formUnion(_ other: `Self`) -
Removes from
selfthe elements that are not also contained inother.Declaration
Swift
public mutating func formIntersection(_ other: `Self`) -
Throws
selfif any errors were reported.Declaration
Swift
public func throwOnError() throws -
Returns the result of calling
actionor captures the Hylo diagnostics it has thrown and returnsnil, rethrowing any other errors.Declaration
Swift
public mutating func capturingErrors<T>( thrownBy action: (inout Self) throws -> T ) rethrows -> T? -
Whether
selfcontains no elements.Declaration
Swift
public var isEmpty: Bool { get } -
Declaration
Swift
public init(arrayLiteral batch: Diagnostic...) -
Declaration
Swift
public var description: String { get }
View on GitHub