-
Notifications
You must be signed in to change notification settings - Fork 26
TypeMetadata
Type metadata refers to those metadata records who declare a new type in Swift. Said metadata records only refer to structs, classes, and enums.
public protocol TypeMetadata: Metadata
ABI Stability: Stable since the following
| macOS | iOS/tvOS | watchOS | Linux | Windows |
|-------|----------|---------|-------|---------|
| 10.14 | 12.2 | 5.2 | NA | NA |
The list of conformances defined for this type metadata.
public var conformances: [ConformanceDescriptor]
NOTE: This list is populated once before the program starts with all of the conformances that are statically know at compile time. If you are attempting to load libraries dynamically at runtime, this list will update automatically, so make sure if you need up to date information on a type's conformances, fetch this often. Example:
let metadata = ...
var conformances = metadata.conformances
loadPlugin(...)
// conformances is now outdated! Refresh it by calling this again.
conformances = metadata.conformances
The base type context descriptor for this type metadata record.
public var contextDescriptor: TypeContextDescriptor
An array of field offsets for this type's stored representation.
public var fieldOffsets: [Int]
An array of types that represent the generic arguments that make up this type.
public var genericTypes: [Any.Type]
An array of metadata records for the types that represent the generic arguments that make up this type.
public var genericMetadata: [Metadata]
Given a mangled type name to some field, superclass, etc., return the type. Using this is the preferred way to interact with mangled type names because this uses the metadata's generic context and arguments and such to fill in generic types along with caching the mangled name for future use.
public func type(
of mangledName: UnsafeRawPointer
) -> Any.Type?
- mangledName: The mangled type name pointer to some type in this metadata's reach.
The type that the mangled type name refers to, if we're able to demangle it.
Generated at 2021-05-06T17:56:33+0000 using swift-doc 1.0.0-beta.6.
Types
- AnonymousDescriptor
- AnonymousDescriptor.Flags
- AnyExistentialContainer
- BoxPair
- ClassDescriptor
- ClassMetadata
- ClassMetadata.Flags
- ConformanceDescriptor
- ConformanceDescriptor.Flags
- ContextDescriptorFlags
- ContextDescriptorKind
- DualExistentialContainer
- EnumDescriptor
- EnumMetadata
- EnumValueWitnessTable
- ExistentialContainer
- ExistentialMetadata
- ExistentialMetadata.Flags
- ExistentialMetatypeMetadata
- ExtensionDescriptor
- FieldDescriptor
- FieldDescriptor.Kind
- FieldRecord
- FieldRecord.Flags
- ForeignClassMetadata
- ForeignMetadataInitialization
- FunctionConvention
- FunctionMetadata
- FunctionMetadata.Flags
- FunctionMetadata.ParamFlags
- GenericContext
- GenericMetadataPattern
- GenericMetadataPattern.Flags
- GenericParameterDescriptor
- GenericParameterKind
- GenericRequirementDescriptor
- GenericRequirementDescriptor.Flags
- GenericRequirementKind
- GenericRequirementLayoutKind
- HeapGenericLocalVariableMetadata
- HeapLocalVariableMetadata
- HeapObject
- KnownMetadata
- KnownMetadata.Builtin
- MetadataAccessFunction
- MetadataBounds
- MetadataInitializationKind
- MetadataKind
- MetadataRequest
- MetadataResponse
- MetadataState
- MetatypeMetadata
- MethodDescriptor
- MethodDescriptor.Flags
- MethodDescriptor.Kind
- MethodOverrideDescriptor
- ModuleDescriptor
- ObjCClassWrapperMetadata
- OpaqueDescriptor
- OpaqueMetadata
- OverrideTableHeader
- ProtocolDescriptor
- ProtocolDescriptor.Flags
- ProtocolRequirement
- ProtocolRequirement.Flags
- ProtocolRequirement.Kind
- ReferenceStorageKind
- SingletonMetadataInitialization
- SpecialProtocol
- StructDescriptor
- StructMetadata
- TupleMetadata
- TupleMetadata.Element
- TypeContextDescriptorFlags
- TypeGenericContext
- TypeReferenceKind
- VTableDescriptorHeader
- ValueOwnership
- ValueWitnessTable
- ValueWitnessTable.Flags
- WitnessTable