diff options
author | 2024-06-19 01:53:40 +0200 | |
---|---|---|
committer | 2024-06-19 01:53:40 +0200 | |
commit | 341c9a3c12aa9d327ef1d8f168ea0adb9b5ad10b (patch) | |
tree | 6a37f29352b1768911b6d42c220f22ebecc202ee /winit/src/proxy.rs | |
parent | 368b15f70896b387ae3f072e807b289b36b2d103 (diff) | |
download | iced-341c9a3c12aa9d327ef1d8f168ea0adb9b5ad10b.tar.gz iced-341c9a3c12aa9d327ef1d8f168ea0adb9b5ad10b.tar.bz2 iced-341c9a3c12aa9d327ef1d8f168ea0adb9b5ad10b.zip |
Introduce `daemon` API and unify shell runtimes
Diffstat (limited to 'winit/src/proxy.rs')
-rw-r--r-- | winit/src/proxy.rs | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/winit/src/proxy.rs b/winit/src/proxy.rs index 0ab61375..d8ad8b3f 100644 --- a/winit/src/proxy.rs +++ b/winit/src/proxy.rs @@ -81,8 +81,19 @@ impl<T: 'static> Proxy<T> { where T: std::fmt::Debug, { + self.send_action(Action::Output(value)); + } + + /// Sends an action to the event loop. + /// + /// Note: This skips the backpressure mechanism with an unbounded + /// channel. Use sparingly! + pub fn send_action(&mut self, action: Action<T>) + where + T: std::fmt::Debug, + { self.raw - .send_event(Action::Output(value)) + .send_event(action) .expect("Send message to event loop"); } |