mirror of
https://github.com/rust-windowing/winit.git
synced 2026-06-27 15:13:13 -04:00
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>
20 lines
361 B
Rust
20 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();
|
|
}
|
|
}
|