lunka_src/
lua_conf.rs

1/// Structure that represents additional configuration for Lua
2/// which cannot be done with command-line definitions.
3/// 
4/// # Preparation of Lua source
5/// This structure cannot be used with a normal Lua source distribution,
6/// as the settings are not able to be modified per Lua build.
7/// `luaconf.h` *must* contain (preferably, in the "local configuration" section) definitions for each field
8/// with `#if defined(...)` guards.
9/// 
10/// For instance, the following snippet for `no_string_to_number` and `extra_space` respectively is appropriate,
11/// assuming it's placed in the "local configuration" section:
12/// ```c
13/// #if defined(LUNKA_NOCVTS2N)
14/// #define LUA_NOCVTS2N
15/// #endif
16/// 
17/// #if defined(LUNKA_EXTRASPACE)
18/// #define LUA_EXTRASPACE LUNKA_EXTRASPACE
19/// #endif
20/// ```
21#[derive(Default, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
22pub struct LuaConf<S> {
23	/// `true` to disable automatic coercion from numbers to strings.
24	/// 
25	/// This corresponds to `LUNKA_NOCVTN2S` for `LUA_NOCVTN2S`.
26	pub no_number_to_string: bool,
27	/// `true` to disable automatic coercion from strings to numbers.
28	/// 
29	/// This corresponds to `LUNKA_NOCVTS2N` for `LUA_NOCVTS2N`.
30	pub no_string_to_number: bool,
31	/// Size of the raw memory area associated with a Lua state with very fast access.
32	/// 
33	/// This corresponds to `LUNKA_EXTRASPACE` for `LUA_EXTRASPACE`.
34	pub extra_space: Option<S>,
35	/// Maximum size for the description of the source of a function in debug information.
36	/// 
37	/// This corresponds to `LUNKA_IDSIZE` for `LUA_IDSIZE`.
38	pub id_size: Option<S>,
39}