Implement native AIS inventory reconciliation (#63)
All checks were successful
Native code generation / deterministic (push) Successful in 13m18s
Imaging and meshing gate / native (push) Successful in 4m12s
Native Rust workspace compile / compile (push) Successful in 4m12s

This commit is contained in:
2026-08-10 06:41:29 +00:00
parent 61d6721287
commit d5c318d280
16 changed files with 1896 additions and 161 deletions

View File

@@ -119,6 +119,7 @@ struct ClientRuntime {
network_manager: Mutex<std::sync::Weak<crate::network_manager::NetworkManagerInner>>,
agent_manager: Mutex<std::sync::Weak<crate::agent_manager::AgentManagerInner>>,
inventory_manager: Mutex<Option<Arc<crate::inventory_manager::InventoryManagerInner>>>,
inventory_ais_client: Mutex<Option<crate::inventory_ais::InventoryAISClient>>,
shutdown_complete: Condvar,
shutdown_wait: Mutex<()>,
}
@@ -148,6 +149,7 @@ impl ClientRuntime {
network_manager: Mutex::new(std::sync::Weak::new()),
agent_manager: Mutex::new(std::sync::Weak::new()),
inventory_manager: Mutex::new(None),
inventory_ais_client: Mutex::new(None),
shutdown_complete: Condvar::new(),
shutdown_wait: Mutex::new(()),
}
@@ -224,6 +226,10 @@ impl ClientRuntime {
.lock()
.unwrap_or_else(std::sync::PoisonError::into_inner)
.take();
self.inventory_ais_client
.lock()
.unwrap_or_else(std::sync::PoisonError::into_inner)
.take();
self.http_caps_client
.lock()
.unwrap_or_else(std::sync::PoisonError::into_inner)
@@ -441,6 +447,30 @@ impl GridClient {
Ok(manager)
}
pub(crate) fn native_ais_client(&self) -> Result<crate::InventoryAISClient, crate::Error> {
let mut cached = self
.runtime
.inventory_ais_client
.lock()
.unwrap_or_else(std::sync::PoisonError::into_inner);
if let Some(client) = cached.as_ref() {
return Ok(client.clone());
}
let client =
crate::inventory_ais::InventoryAISClient::native_new(Some(Arc::new(self.clone())))?;
*cached = Some(client.clone());
Ok(client)
}
#[allow(clippy::needless_pass_by_value)]
pub(crate) fn native_set_ais_client(&mut self, value: crate::InventoryAISClient) {
*self
.runtime
.inventory_ais_client
.lock()
.unwrap_or_else(std::sync::PoisonError::into_inner) = Some(value);
}
#[allow(clippy::needless_pass_by_value)] // The mapped C# property setter owns its value.
pub(crate) fn native_set_inventory(&mut self, value: crate::InventoryManager) {
*self