RequirementSequence
public struct RequirementSequence : IteratorProtocol, Sequence, Sendable
A sequence with the requirements of a trait declaration.
-
Declaration
Swift
public typealias Element = AnyDeclID -
The declaration of the trait defining the requirements in this sequence.
Declaration
Swift
private let base: TraitDecl.ID -
An index in the members of
base.Declaration
Swift
private var member: Int -
An index in the variants of
ast[base].members[member]if it’s a bundle.Declaration
Swift
private var variant: Int -
-
Advances to the next requirement and returns it, or
nilif no next requirement exists.Declaration
Swift
public mutating func next() -> AnyDeclID? -
Advances to the next requirement variant in
bundleand returns it, ornilif no next variant exists.Declaration
Swift
private mutating func next<T>(in bundle: T.ID) -> AnyDeclID? where T : BundleDecl
View on GitHub