Struct BlittableStructRef<T>
Represents a pointer to a structure.
public readonly struct BlittableStructRef<T> where T : struct
Type Parameters
T
- Inherited Members
Constructors
BlittableStructRef(nint)
Initializes a new instance of the BlittableStructRef<T> struct.
public BlittableStructRef(nint ptr)
Parameters
ptrnintThe pointer value.
Properties
HasValue
Gets a value indicating whether the pointer has a value (is not a null pointer).
public bool HasValue { get; }
Property Value
Value
Gets the value this pointer points to. Uses PtrToStructure<T>(nint) marshalling for marshalling the structure.
public T Value { get; }
Property Value
- T
Methods
GetValueOrDefault()
Gets the value this pointer points to or the default value of T if the pointer is null.
public T GetValueOrDefault()
Returns
- T
The value this pointer points to or the default value of
Tif the pointer is null.
GetValueOrDefault(T)
Gets the value this pointer points to or the specified defaultValue if the pointer is null.
public T GetValueOrDefault(T defaultValue)
Parameters
defaultValueTThe default value to return if the pointer is null.
Returns
- T
The value this pointer points to or the default value if the pointer is null.