winit/src/platform_impl/web/event_loop/proxy.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

18 lines
332 B
Rust
Raw Normal View History

use super::runner::WeakShared;
2023-10-16 15:50:22 +02:00
use crate::platform_impl::platform::r#async::Waker;
2019-06-25 03:15:34 +02:00
#[derive(Clone)]
pub struct EventLoopProxy {
runner: Waker<WeakShared>,
2019-06-25 03:15:34 +02:00
}
impl EventLoopProxy {
pub fn new(runner: Waker<WeakShared>) -> Self {
Self { runner }
2019-06-25 03:15:34 +02:00
}
pub fn wake_up(&self) {
2023-10-16 15:50:22 +02:00
self.runner.wake();
2019-09-24 19:39:13 -04:00
}
}