TypeLayout
public struct TypeLayout : Regular
The layout of a type in memory, including the positions of its parts.
-
Memory layout of a type, without any detail about parts.
See moreDeclaration
Swift
public struct Bytes : Regular -
Aggregate layout values of this layout.
Declaration
Swift
public let bytes: Bytes -
The minimum alignment of an instance. Always a power of 2.
Declaration
Swift
public var alignment: Int { get } -
The number of bytes occupied by an instance.
Declaration
Swift
public var size: Int { get } -
The number of bytes between the beginnings of consecutive array elements.
Declaration
Swift
public var stride: Int { get } -
The type whose layout is described by
self.Declaration
Swift
public let type: AnyType -
The structure.
For product types, info for each stored property in storage order. For union types, info for each case when it is active, followed by info for the discriminator. Empty otherwise (built-in types).
Declaration
Swift
public let parts: [Part] -
The parentage of the parts.
For product types, the parentage of each stored property in storage order. For union types, the parentage of each case when it is active, followed by the parentage of the discriminator. Empty otherwise (built-in types).
Declaration
Swift
public var partParentages: some Collection<Part.Parentage> { get } -
True iff
selfis the layout of a union type, which changes how itspartsare interpreted.Declaration
Swift
public let isUnionLayout: Bool -
The discriminator of a union layout.,
Declaration
Swift
public var discriminator: Part { get } -
The id of the discriminator of a union layout.,
Declaration
Swift
public var discriminatorParentage: Part.Parentage { get } -
The number of parts that will be stored at one time for a given instance.
Declaration
Swift
public var storedPartCount: Int { get }
View on GitHub