mirror of
https://github.com/feschber/lan-mouse.git
synced 2026-03-24 21:50:57 +03:00
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:
committed by
GitHub
parent
a987f93133
commit
648b2b58a4
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user