arch: split ConfigRepository, extract polling, consolidate conversions, decouple protocol
- Value↔JSON: From impls on domain Value behind `json` feature, delete 4 duplicate converters - ConfigRepository split into ConfigRepository (12), UserRepository (3), WidgetStateCache (2) - polling orchestration moved from bootstrap to application::polling_service - WidgetRenderer in client-domain owns scroll/cache, both clients use it - network loop consolidated into client-application::run_connection_loop - protocol crate drops domain dep, Wire↔Domain conversions move to adapters
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
use domain::{
|
||||
ConfigRepository, DataSource, DataSourceId, Layout, LayoutPreset, LayoutPresetId, ThemeConfig,
|
||||
User, WidgetConfig, WidgetId, WidgetState,
|
||||
User, UserRepository, WidgetConfig, WidgetId, WidgetState, WidgetStateCache,
|
||||
};
|
||||
use std::collections::HashMap;
|
||||
use std::sync::RwLock;
|
||||
@@ -177,6 +177,10 @@ impl ConfigRepository for MemoryConfigStore {
|
||||
guard.remove(&id);
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
||||
impl UserRepository for MemoryConfigStore {
|
||||
type Error = MemoryConfigError;
|
||||
|
||||
async fn get_user_by_username(&self, username: &str) -> Result<Option<User>, Self::Error> {
|
||||
let guard = self
|
||||
@@ -203,6 +207,10 @@ impl ConfigRepository for MemoryConfigStore {
|
||||
.map_err(|_| MemoryConfigError::LockPoisoned)?;
|
||||
Ok(guard.len() as u32)
|
||||
}
|
||||
}
|
||||
|
||||
impl WidgetStateCache for MemoryConfigStore {
|
||||
type Error = MemoryConfigError;
|
||||
|
||||
async fn save_widget_states(
|
||||
&self,
|
||||
|
||||
Reference in New Issue
Block a user