#[non_exhaustive]pub enum LuaVersion {
V51,
V52,
V53,
V54,
V55,
}Expand description
Which Lua language version a runtime instance speaks.
Default is LuaVersion::V54 — the version this codebase currently
implements end-to-end — so that Lua::new() and any other defaulted
construction keeps the existing 5.4 behavior.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
V51
Lua 5.1 — float-only, fenv-based globals. Deferred (separate core).
V52
Lua 5.2 — float-only, modern _ENV globals. Deferred (separate core).
V53
Lua 5.3 — dual subtype, modern _ENV. Deferred.
V54
Lua 5.4 — the implemented baseline today.
V55
Lua 5.5 — dual subtype, declared-globals scope model. Deferred.
Implementations§
Source§impl LuaVersion
impl LuaVersion
Sourcepub fn number_model(self) -> NumberModel
pub fn number_model(self) -> NumberModel
The family-level numeric model for this version.
Sourcepub fn is_supported(self) -> bool
pub fn is_supported(self) -> bool
Whether this version has a real backend. The modern family (5.3/5.4/5.5)
is implemented; 5.1/5.2 (the float-only legacy family) are not yet, so
they must REFUSE rather than silently run as 5.4 (which would expose
integers, //, goto, etc. that 5.1 lacks — a misleading masquerade).
Sourcepub fn version_str(self) -> &'static str
pub fn version_str(self) -> &'static str
The _VERSION global string for this version (e.g. "Lua 5.4").
Sourcepub fn luac_version_byte(self) -> u8
pub fn luac_version_byte(self) -> u8
The LUAC_VERSION byte written into a luac/string.dump header for
this version. Upstream encodes the version as (major << 4) | minor,
e.g. 5.4 → 0x54.
Trait Implementations§
Source§impl Clone for LuaVersion
impl Clone for LuaVersion
Source§fn clone(&self) -> LuaVersion
fn clone(&self) -> LuaVersion
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for LuaVersion
impl Debug for LuaVersion
Source§impl Default for LuaVersion
impl Default for LuaVersion
Source§fn default() -> LuaVersion
fn default() -> LuaVersion
Source§impl Hash for LuaVersion
impl Hash for LuaVersion
Source§impl PartialEq for LuaVersion
impl PartialEq for LuaVersion
Source§fn eq(&self, other: &LuaVersion) -> bool
fn eq(&self, other: &LuaVersion) -> bool
self and other values to be equal, and is used by ==.