Lua Notes

string type conversions
Login

string type conversions

nelua strings are defined as @record{data: *[0]byte, size: usize}, which is identical to span(byte), where 'data' is identical to cstring (barring any complaints about signed cchar).

nelua also expects strings to be immutable and for 'data' to always be zero-terminated. Violating these expectations can result in panicking runtime checks, among other surprising behaviors.

Legend:

from string

from span

from sequence(byte)

from cstring

from pointer and length