feat!: Improve lua module registration

Instead of having to call all the module registration functions in one
place it is possible for each module to register itself in a global registry.
During startup all the all the modules will be registered
automatically.

This does currently have one weakness, to need to ensure that the crate
is linked.
This commit is contained in:
2025-09-10 01:24:21 +02:00
parent d008bb0786
commit 07e2d18a28
7 changed files with 56 additions and 4 deletions

12
Cargo.lock generated
View File

@@ -100,6 +100,7 @@ dependencies = [
"git-version",
"google_home",
"hostname",
"inventory",
"mlua",
"reqwest",
"rumqttc",
@@ -128,6 +129,7 @@ dependencies = [
"dyn-clone",
"eui48",
"google_home",
"inventory",
"mlua",
"reqwest",
"rumqttc",
@@ -151,6 +153,7 @@ dependencies = [
"futures",
"google_home",
"indexmap",
"inventory",
"mlua",
"rumqttc",
"serde",
@@ -967,6 +970,15 @@ dependencies = [
"serde",
]
[[package]]
name = "inventory"
version = "0.3.21"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bc61209c082fbeb19919bee74b176221b27223e27b65d781eb91af24eb1fb46e"
dependencies = [
"rustversion",
]
[[package]]
name = "io-uring"
version = "0.7.10"