Skip to main content

allwright_surface_mobile/
lib.rs

1use allwright_plugin_sdk::{SurfaceFamily, SurfacePluginDescriptor};
2use tokio::time::{Duration, sleep};
3
4pub const SURFACE_ID: &str = "mobile";
5
6pub fn shared_descriptor() -> SurfacePluginDescriptor {
7    SurfacePluginDescriptor {
8        id: SURFACE_ID,
9        family: SurfaceFamily::Mobile,
10        version: env!("CARGO_PKG_VERSION"),
11        description: "Shared mobile surface abstractions for Android and iOS plugins.",
12    }
13}
14
15pub async fn boot() -> String {
16    sleep(Duration::from_millis(25)).await;
17    "mobile ready".to_string()
18}
19
20#[cfg(test)]
21mod tests {
22    use super::*;
23
24    #[tokio::test]
25    async fn boots_mobile_runtime() {
26        assert_eq!(boot().await, "mobile ready");
27    }
28}