pub enum ScriptLanguage {
Lua,
Shell,
Python,
LuaExternal,
}Variants§
Lua
The embedded, sandboxed interpreter (Lua). Always available.
Shell
A shell script (bash or sh; pwsh or powershell for a PowerShell script), run as an external process speaking JSON lines. Allowed by default when a shell is found.
Python
A Python script, external process. Off by default in settings.
LuaExternal
A Lua script run by an installed lua (not the embedded one), external
process. Off by default in settings.
Implementations§
Source§impl ScriptLanguage
impl ScriptLanguage
Sourcepub const ALL: [ScriptLanguage; 4]
pub const ALL: [ScriptLanguage; 4]
Every language, in the order the rule form offers them.
Sourcepub fn is_external(self) -> bool
pub fn is_external(self) -> bool
Runs as a process of its own, unsandboxed, with the user’s rights.
Sourcepub fn name(self) -> &'static str
pub fn name(self) -> &'static str
The stable name used by the CLI (--script-lang) and in messages.
Sourcepub fn from_name(name: &str) -> Option<Self>
pub fn from_name(name: &str) -> Option<Self>
Parses ScriptLanguage::name.
Sourcepub fn setting_name(self) -> Option<&'static str>
pub fn setting_name(self) -> Option<&'static str>
The value of rewrite.external_scripts that switches this language
on (None: the embedded Lua, always available).
Sourcepub fn from_extension(path: &str) -> Option<Self>
pub fn from_extension(path: &str) -> Option<Self>
The language a script file’s extension suggests.