OpaquePointer

struct OpaquePointer

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 CVarArg, CustomDebugStringConvertible, Equatable, Hashable View Protocol Hierarchy →
Import import Swift

Initializers

init(_: UnsafeMutableRawPointer)

Declaration

init(_ from: UnsafeMutableRawPointer)
init(_: UnsafeRawPointer)

Declaration

init(_ from: UnsafeRawPointer)
init<T>(_: UnsafeMutablePointer<T>)

Converts a typed UnsafeMutablePointer to an opaque C pointer.

Declaration

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

Converts a typed UnsafePointer to an opaque C pointer.

Declaration

init<T>(_ from: UnsafePointer<T>)
init?(_: UnsafeMutableRawPointer?)

Declaration

init?(_ from: UnsafeMutableRawPointer?)
init?(_: UnsafeRawPointer?)

Declaration

init?(_ from: UnsafeRawPointer?)
init?<T>(_: UnsafeMutablePointer<T>?)

Converts a typed UnsafeMutablePointer to an opaque C pointer.

The result is nil if from is nil.

Declaration

init?<T>(_ from: UnsafeMutablePointer<T>?)
init?<T>(_: UnsafePointer<T>?)

Converts a typed UnsafePointer to an opaque C pointer.

The result is nil if from is nil.

Declaration

init?<T>(_ from: UnsafePointer<T>?)
init?(bitPattern: Int)

Creates an OpaquePointer from a given address in memory.

Declaration

init?(bitPattern: Int)
init?(bitPattern: UInt)

Creates an OpaquePointer from a given address in memory.

Declaration

init?(bitPattern: UInt)

Instance Variables

var debugDescription: String

A textual representation of the pointer, suitable for debugging.

Declaration

var debugDescription: String { get }
var hashValue: Int

The pointer's hash value.

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 ==(_:rhs:)

Returns a Boolean value indicating whether two values are equal.

Equality is the inverse of inequality. For any values a and b, a == b implies that a != b is false.

Parameters: lhs: A value to compare. rhs: Another value to compare.

Declaration

func ==(lhs: OpaquePointer, rhs: OpaquePointer) -> Bool