This commit is contained in:
Nathan Sobo 2023-09-22 08:33:51 -06:00
parent d120d0cf2e
commit e979d75cb8
5 changed files with 213 additions and 30 deletions

View file

@ -36,12 +36,12 @@ pub use mac::*;
pub use test::*;
#[cfg(target_os = "macos")]
pub(crate) fn current_platform() -> Rc<dyn Platform> {
pub(crate) fn current_platform() -> Arc<dyn Platform> {
Rc::new(MacPlatform::new())
}
pub trait Platform {
fn executor(&self) -> Rc<ForegroundExecutor>;
fn dispatcher(&self) -> Arc<dyn PlatformDispatcher>;
fn text_system(&self) -> Arc<dyn PlatformTextSystem>;
fn run(&self, on_finish_launching: Box<dyn FnOnce()>);