winit/src/platform_impl/web/event_loop/proxy.rs
Kirill Chibisov ecb887e5c3
event_loop: remove generic user event
Let the users wake up the event loop and then they could poll their
user sources.

Co-authored-by: Mads Marquart <mads@marquart.dk>
Co-authored-by: daxpedda <daxpedda@gmail.com>
2024-06-24 13:04:55 +03:00

19 lines
361 B
Rust

use std::rc::Weak;
use super::runner::Execution;
use crate::platform_impl::platform::r#async::Waker;
#[derive(Clone)]
pub struct EventLoopProxy {
runner: Waker<Weak<Execution>>,
}
impl EventLoopProxy {
pub fn new(runner: Waker<Weak<Execution>>) -> Self {
Self { runner }
}
pub fn wake_up(&self) {
self.runner.wake();
}
}