FFIArray

rorm FFI struct definition for arrays and strings (equivalent to D and Rust slices)

Constructors

this
this(typeof(null) )
Undocumented in source.
this
this(T* content, size_t size)
Undocumented in source.

Members

Aliases

opSlice
alias opSlice = data

Does a zero-copy conversion of this FFIArray to a D slice. Regular slice ownership semantics, e.g. variable lifetime, still apply. DIP1000 should help avoid lifetime issues.

Functions

data
inout(T)[] data()

Does a zero-copy conversion of this FFIArray to a D slice. Regular slice ownership semantics, e.g. variable lifetime, still apply. DIP1000 should help avoid lifetime issues.

toString
string toString()
Undocumented in source. Be warned that the author may not have intended to support it.

Static functions

fromData
FFIArray fromData(T[] data)
FFIArray fromData(T[n] data)

Zero-copy conversion of a native D slice to an FFIArray. The resulting FFIArray has the same lifetime as the native D slice, so a stack allocated slice will also cause the FFIArray to become invalid when leaving its scope. DIP1000 should help avoid such issues.

Variables

content
T* content;

Pointer to the first item in the slice.

size
size_t size;

The length of the slice. (count of elements)

Meta