Refactor the imp/gui bondary to use real traits #18
Reference in New Issue
Block a user
Delete Branch "gui-platform-boundary-refactor"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Introduces a trait-based platform abstraction layer that makes the boundary
between platform-specific and shared code explicit and compile-time verified.
The TLDR version of this new trait stuff works:
PlatformInterfacetrait.WebPlatform).PlatformimplementsPlatformInterface.Motivation
Previously, platform code used a mix of pub use re-exports and #[cfg] blocks
that made it difficult to understand what each platform must implement. The
new trait-based approach provides:
functionality
Changes
New traits in imp/mod.rs:
Type aliases:
feature flags
Call site updates:
Testing
Manual testing reveals that Web and Desktop still work, I (Liam) have not tested the mobile version beyond compilation.
440c51735cto4a8a4de252We also need to add a description to this PR ;)
@@ -1,12 +1,87 @@use crate::app::Command;Add a doc comment here for what this file is, here and elsewhere in imp
I'm not sure if this is actually needed.
@@ -7,3 +8,2 @@pub use super::connect::*;pub use super::native_audio::*;// ============================================================================Delete this bar
@@ -3,0 +15,4 @@// Trait Definitions// ============================================================================pub trait AudioSystemInterface: Sized {We need to add a doc comment for the overall trait here.
Done
d668e9a513to3ca2ec2a06bc33cfd732tob89907715bb89907715bto5f3466546e