LuaD



enum  LuaType: int;

Enumerates all Lua types.


string


number


 Nil

nil


boolean


function


userdata


thread


Nil  nil;

Special value representing the Lua type and value  nil.

Examples
Useful for clearing keys in a table:
lua["n"] = 1.23;
assert(lua.get!double("n") == 1.23);

lua["n"] = nil;
assert(lua["n"].type == LuaType.Nil);

struct  LuaObject;

Represents a reference to a Lua value of any type. It contains only the bare minimum of functionality which all Lua values support. For a generic reference type with more functionality, see luad.dynamic.LuaDynamic.


pure nothrow @property @safe lua_State*  state();

The underlying lua_State pointer for interfacing with C.


pure nothrow @safe void  release();

Release this reference.

This reference becomes a nil reference. This is only required when you want to release the reference before the lifetime of this LuaObject has ended.


nothrow @property @trusted LuaType  type();

Type of referenced object.

See Also
LuaType

@property @trusted string  typeName();

Type name of referenced object.


pure nothrow @property @safe bool  isNil();

Boolean whether or not the referenced object is nil.


@trusted string  toString();

Convert the referenced object into a textual representation.

The returned string is formatted in the same way the Lua tostring function formats.

Returns
String representation of referenced object

T  to(T)();

Attempt to convert the referenced object to the specified D type.

Examples
auto results = lua.doString(`return "hello!"`);
assert(results[0].to!string() == "hello!");

@trusted bool  opEquals(T : LuaObject)(ref T o);

Compare this object to another with Lua's equality semantics. Also returns false if the two objects are in different Lua states.