Table of Contents

Struct NativePointer

Namespace
Maplibre.NativeFfi
Assembly
Maplibre.NativeFfi.dll

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

nint

IsNull

Whether the address is zero.

public bool IsNull { get; }

Property Value

bool

Null

A null native pointer.

public static NativePointer Null { get; }

Property Value

NativePointer

Methods

Equals(NativePointer)

Indicates whether the current object is equal to another object of the same type.

public bool Equals(NativePointer other)

Parameters

other NativePointer

An object to compare with this object.

Returns

bool

true if the current object is equal to the other parameter; otherwise, false.

Equals(object?)

Indicates whether this instance and a specified object are equal.

public override bool Equals(object? obj)

Parameters

obj object

The object to compare with the current instance.

Returns

bool

true if obj and 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

address nint

Returns

NativePointer

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

left NativePointer
right NativePointer

Returns

bool

operator !=(NativePointer, NativePointer)

public static bool operator !=(NativePointer left, NativePointer right)

Parameters

left NativePointer
right NativePointer

Returns

bool