Skip to content

PgContextValue<T>

Namespace: Ankus

Assembly: Ankus.Runtime.dll

Holds one checked unmanaged value whose storage is reclaimed by its PostgreSQL context.

public sealed class PgContextValue<T> where T : unmanaged

Type parameters:

T

The unmanaged representation copied to and from native storage.

This wrapper has no individual disposal or finalizer. Collection of the wrapper never frees native bytes or invokes a value destructor. Unmanaged storage does not establish a C ABI or SQL type.

Inheritance: object

Gets the requested explicit alignment, or zero for the server default.

public nuint Alignment { get; }

Value: nuint

Gets the allocation’s actual native owner while the allocation remains live.

public PgMemoryContext Context { get; }

Value: PgMemoryContext

Gets the original initialization and native size policies.

public PgAllocationOptions Options { get; }

Value: PgAllocationOptions

Gets or sets a copied value while its native context and allocation remain live.

public T Value { get; set; }

Value: T

Borrows a typed view sharing this value’s checked allocation lifetime.

public PgNativeReference<T> Borrow()

Returns: PgNativeReference<T>

A non-owning view.

Copies all representation bytes into independent context-owned storage.

public PgContextValue<T> CloneInto(PgMemoryContext? context = null)

Parameters:

context — PgMemoryContext

The destination context, or null for the current context.

Returns: PgContextValue<T>

A shallow context-owned copy with default allocation policies.

Copies all representation bytes into independent individually owned storage.

public PgNativeBox<T> CloneOwnedInto(PgMemoryContext? context = null)

Parameters:

context — PgMemoryContext

The destination context, or null for the current context.

Returns: PgNativeBox<T>

A shallow individually owned copy with default allocation policies.