Skip to main content

lux_lib/lua/
mod.rs

1//! Special utilities for the Lua bridge.
2
3pub mod binary;
4pub mod detect;
5pub mod installation;
6pub mod version;
7
8pub use binary::Binary;
9pub use installation::Installation;
10pub use version::Version;
11
12use tokio::runtime::{Builder, Runtime};
13
14use lazy_static::lazy_static;
15
16lazy_static! {
17    static ref LUA_RUNTIME: Runtime = {
18        let span = tracing::debug_span!("Initialising Lua runtime");
19        let _enter = span.enter();
20        #[allow(clippy::expect_used)]
21        Builder::new_multi_thread()
22            .enable_all()
23            .build()
24            .expect("Failed to initialise Lua runtime")
25    };
26}
27
28pub fn runtime() -> &'static Runtime {
29    &LUA_RUNTIME
30}