#[non_exhaustive]pub enum Feature {
Show 18 variants
IntegerSubtype,
EnvSandbox,
FenvSandbox,
GotoLabels,
NativeBitwise,
Bit32Lib,
Utf8Lib,
StringPack,
CloseAttribute,
ConstAttribute,
CoroutineClose,
WarnFunction,
TableLenMetamethod,
GcIsRunning,
GcParam,
GlobalKeyword,
NamedVararg,
TableCreate,
}Expand description
A version-divergent language capability — one present-or-absent row of the
support matrix (issue #234). Behavioral divergences (same call, different
result — e.g. <=-from-__lt, integer for-loop wraparound, the RNG stream)
are deliberately not features: they are resolved inside the core, not
gated. Query with LuaVersion::supports.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
IntegerSubtype
Integer/float subtypes and math.type — 5.3+.
EnvSandbox
_ENV and load(.., env) lexical-environment sandboxing — 5.2+.
FenvSandbox
setfenv/getfenv function-environment access — 5.1 only.
GotoLabels
goto and ::labels:: — 5.2+.
NativeBitwise
Native bitwise operators & | ~ << >> and integer division // — 5.3+.
Bit32Lib
The bit32 library — 5.2 and 5.3 (removed in 5.4).
Utf8Lib
The utf8 library — 5.3+.
StringPack
string.pack/string.unpack/string.packsize — 5.3+.
CloseAttribute
<close> to-be-closed variables and the __close metamethod — 5.4+.
ConstAttribute
<const> variables — 5.4+.
CoroutineClose
coroutine.close — 5.4+.
WarnFunction
The warn function — 5.4+.
TableLenMetamethod
The __len metamethod honored on tables (not just userdata) — 5.2+.
GcIsRunning
collectgarbage("isrunning") — 5.2+.
GcParam
collectgarbage("param", name [, value]) — 5.5.
GlobalKeyword
The global declaration keyword and declared-global scope model — 5.5.
NamedVararg
Named vararg table parameters function f(a, ...t) — 5.5.
TableCreate
table.create — 5.5.
Implementations§
Source§impl Feature
impl Feature
Sourcepub const ALL: [Feature; 18]
pub const ALL: [Feature; 18]
Every Feature, the iteration source for LuaVersion::features and
the matrix-vs-reference test. A match in the test asserts this is
exhaustive, so adding a variant without adding it here fails to compile.
Sourcepub fn name(self) -> &'static str
pub fn name(self) -> &'static str
A short, stable token naming this feature, used in the fixture and in the
Unsupported error message.