Save config (#345)

* add setters for clients and authorized keys

* impl change config request

* basic saving functionality

* save config automatically

* add TODO comment
This commit is contained in:
Ferdinand Schober
2026-02-07 18:36:07 +01:00
committed by GitHub
parent a987f93133
commit 648b2b58a4
7 changed files with 160 additions and 11 deletions

View File

@@ -15,6 +15,15 @@ pub struct ClientManager {
}
impl ClientManager {
/// get all clients
pub fn clients(&self) -> Vec<(ClientConfig, ClientState)> {
self.clients
.borrow()
.iter()
.map(|(_, c)| c.clone())
.collect::<Vec<_>>()
}
/// add a new client to this manager
pub fn add_client(&self) -> ClientHandle {
self.clients.borrow_mut().insert(Default::default()) as ClientHandle