COpaquePointer

struct COpaquePointer

A wrapper around an opaque C pointer.

Opaque pointers are used to represent C pointers to types that cannot be represented in Swift, such as incomplete struct types.

Inheritance CVarArgType, DebugPrintable, Equatable, Hashable, NilLiteralConvertible View Protocol Hierarchy →
Import import Swift

Initializers

init()

Construct a nil instance.

Declaration

init()
init<T>(_: CFunctionPointer<T>)

Reinterpret the bits of value as COpaquePointer.

Warning: This is a fundamentally unsafe operation, equivalent to unsafeBitCast(value, COpaquePointer.self)

Declaration

init<T>(_ value: CFunctionPointer<T>)
init<T>(_: UnsafeMutablePointer<T>)

Convert a typed UnsafeMutablePointer to an opaque C pointer.

Declaration

init<T>(_ source: UnsafeMutablePointer<T>)
init<T>(_: UnsafePointer<T>)

Convert a typed UnsafePointer to an opaque C pointer.

Declaration

init<T>(_ source: UnsafePointer<T>)
init(bitPattern: UWord)

Construct a COpaquePointer from a given address in memory.

This is a fundamentally unsafe conversion.

Declaration

init(bitPattern: UWord)
init(bitPattern: Word)

Construct a COpaquePointer from a given address in memory.

This is a fundamentally unsafe conversion.

Declaration

init(bitPattern: Word)
init(nilLiteral:)

Create an instance initialized with nil.

Declaration

init(nilLiteral: ())

Instance Variables

var debugDescription: String

A textual representation of self, suitable for debugging.

Declaration

var debugDescription: String { get }
var hashValue: Int

The hash value.

Axiom: x == y implies x.hashValue == y.hashValue

Note: the hash value is not guaranteed to be stable across different invocations of the same program. Do not persist the hash value across program runs.

Declaration

var hashValue: Int { get }

Instance Methods

func encode()

Transform self into a series of machine words that can be appropriately interpreted by C varargs

Declaration

func encode() -> [Word]