1
0
Fork 0
forked from wry/wry

config: move handlers to State

This commit is contained in:
Julian Orth 2026-03-07 14:40:26 +01:00
parent 97f7b68369
commit 6e25180d92
6 changed files with 204 additions and 109 deletions

View file

@ -67,13 +67,15 @@ impl JayIdleRequestHandler for JayIdle {
fn set_interval(&self, req: SetInterval, _slf: &Rc<Self>) -> Result<(), Self::Error> {
let interval = Duration::from_secs(req.interval);
self.client.state.idle.set_timeout(interval);
let state = &self.client.state;
state.idle.set_timeout(interval);
Ok(())
}
fn set_grace_period(&self, req: SetGracePeriod, _slf: &Rc<Self>) -> Result<(), Self::Error> {
let period = Duration::from_secs(req.period);
self.client.state.idle.set_grace_period(period);
let state = &self.client.state;
state.idle.set_grace_period(period);
Ok(())
}
}