mod.rs

 1mod event;
 2#[cfg(target_os = "macos")]
 3pub mod mac;
 4pub mod current {
 5    #[cfg(target_os = "macos")]
 6    pub use super::mac::*;
 7}
 8
 9use std::path::PathBuf;
10
11use event::Event;
12
13pub trait App {
14    fn on_finish_launching<F: 'static + FnOnce()>(self, callback: F) -> Self where;
15    fn on_become_active<F: 'static + FnMut()>(self, callback: F) -> Self;
16    fn on_resign_active<F: 'static + FnMut()>(self, callback: F) -> Self;
17    fn on_event<F: 'static + FnMut(Event) -> bool>(self, callback: F) -> Self;
18    fn on_open_files<F: 'static + FnMut(Vec<PathBuf>)>(self, callback: F) -> Self;
19    fn run(self);
20}