Struct NativePointer
Borrowed opaque backend-native address.
public readonly struct NativePointer : IEquatable<NativePointer>
- Implements
- Inherited Members
Remarks
This value grants no memory access, transfers no ownership, and is accepted only by APIs whose C contract already accepts opaque host-owned handles.
Properties
Address
The borrowed opaque address value.
public nint Address { get; }
Property Value
IsNull
Whether the address is zero.
public bool IsNull { get; }
Property Value
Null
A null native pointer.
public static NativePointer Null { get; }
Property Value
Methods
Equals(NativePointer)
Indicates whether the current object is equal to another object of the same type.
public bool Equals(NativePointer other)
Parameters
otherNativePointerAn object to compare with this object.
Returns
Equals(object?)
Indicates whether this instance and a specified object are equal.
public override bool Equals(object? obj)
Parameters
objobjectThe object to compare with the current instance.
Returns
- bool
true if
objand this instance are the same type and represent the same value; otherwise, false.
FromBorrowedAddress(nint)
Creates a borrowed backend-native pointer value from a host-owned address.
public static NativePointer FromBorrowedAddress(nint address)
Parameters
addressnint
Returns
Remarks
The caller keeps the backend object alive and synchronized for the full borrow window documented by the API receiving this value.
GetHashCode()
Returns the hash code for this instance.
public override int GetHashCode()
Returns
- int
A 32-bit signed integer that is the hash code for this instance.
ToString()
Returns the fully qualified type name of this instance.
public override string ToString()
Returns
- string
The fully qualified type name.
Operators
operator ==(NativePointer, NativePointer)
public static bool operator ==(NativePointer left, NativePointer right)
Parameters
leftNativePointerrightNativePointer
Returns
operator !=(NativePointer, NativePointer)
public static bool operator !=(NativePointer left, NativePointer right)
Parameters
leftNativePointerrightNativePointer