Draft web platform structure

This commit is contained in:
Héctor Ramón Jiménez 2019-06-25 03:15:34 +02:00
parent eea9530f38
commit c5703eb00a
26 changed files with 1171 additions and 153 deletions

View file

@ -0,0 +1,19 @@
use super::runner;
use crate::event::Event;
use crate::event_loop::EventLoopClosed;
#[derive(Clone)]
pub struct Proxy<T: 'static> {
runner: runner::Shared<T>,
}
impl<T: 'static> Proxy<T> {
pub fn new(runner: runner::Shared<T>) -> Self {
Proxy { runner }
}
pub fn send_event(&self, event: T) -> Result<(), EventLoopClosed> {
self.runner.send_event(Event::UserEvent(event));
Ok(())
}
}