Skip to content

GenericRequirementDescriptor

tevelee edited this page Jul 25, 2026 · 4 revisions

GenericRequirementDescriptor

This descriptor describes any generic requirement in either a generic context or in a protocol's requirement signature.

public struct GenericRequirementDescriptor: LayoutWrapper 

ABI Stability: Stable since the following

| macOS | iOS/tvOS | watchOS | Linux | Windows |
|-------|----------|---------|-------|---------|
| 10.14 | 12.2     | 5.2     | NA    | NA      |

Inheritance

LayoutWrapper

Properties

flags

The flags that describe this generic requirement.

public var flags: Flags 

paramMangledName

The mangled name for this requirement's parameter.

public var paramMangledName: UnsafeRawPointer 

mangledTypeName

If this requirement is a same-type, base-class, or same-shape requirement, this is the mangled name for the constrained type or pack.

public var mangledTypeName: UnsafeRawPointer 

`protocol`

If this requirement is a protocol, this is the protocol descriptor to said protocol being constrained.

public var `protocol`: ProtocolDescriptor 

layoutKind

If this requirement is some layout (currently can only be a class), this is the kind of layout that's being constrained.

public var layoutKind: GenericRequirementLayoutKind 

invertedProtocols

The capability protocols inverted by this requirement, such as Copyable for a ~Copyable generic parameter.

public var invertedProtocols: InvertibleProtocolSet 

invertedProtocolsGenericParameterIndex

The generic parameter affected by invertedProtocols.

public var invertedProtocolsGenericParameterIndex: UInt16 

UInt16.max means the constraint applies to the requirement subject rather than a direct generic parameter.

Types
Protocols
Global Typealiases
Global Variables
Global Functions

Clone this wiki locally