mirror of
https://github.com/speatzle/nfsense.git
synced 2025-09-13 15:19:08 +00:00
add zbus for systemd interaction
This commit is contained in:
parent
28e13f0192
commit
c51b528521
4 changed files with 571 additions and 2 deletions
|
@ -53,12 +53,17 @@ async fn main() {
|
|||
sessions: Arc::new(RwLock::new(HashMap::new())),
|
||||
};
|
||||
|
||||
info!("Connecting to System dbus...");
|
||||
let dbus_conn = zbus::Connection::system().await.unwrap();
|
||||
|
||||
let app_state = AppState {
|
||||
config_manager: config_manager.clone(),
|
||||
session_state: session_state.clone(),
|
||||
dbus_conn: dbus_conn.clone(),
|
||||
rpc_module: api::new_rpc_module(RpcState {
|
||||
config_manager,
|
||||
session_state,
|
||||
dbus_conn,
|
||||
}),
|
||||
};
|
||||
|
||||
|
|
|
@ -8,10 +8,12 @@ pub struct AppState {
|
|||
pub config_manager: ConfigManager,
|
||||
pub session_state: SessionState,
|
||||
pub rpc_module: RpcModule<RpcState>,
|
||||
pub dbus_conn: zbus::Connection,
|
||||
}
|
||||
|
||||
#[derive(Clone)]
|
||||
pub struct RpcState {
|
||||
pub config_manager: ConfigManager,
|
||||
pub session_state: SessionState,
|
||||
pub dbus_conn: zbus::Connection,
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue