(&mut self, enabled: bool)
| 253 | } |
| 254 | |
| 255 | fn set_sync(&mut self, enabled: bool) -> io::Result<bool> { |
| 256 | self.request_tx.send(Request::SetSync(enabled)).expect("Channel must be alive"); |
| 257 | match self.response_rx.recv().expect("Channel must be alive") { |
| 258 | Response::SetSync(result) => result, |
| 259 | _ => panic!("Unexpected response type"), |
| 260 | } |
| 261 | } |
| 262 | |
| 263 | async fn play_tone(&mut self, tone: Tone) -> io::Result<()> { |
| 264 | self.call(Request::PlayTone(tone)) |