sshuttle-gui/src/lib.rs
Emil Ernerfeldt 8d86ae1715 Initial commit
Using the latest unpublished Egui.
Will update to 0.6 once released.
2020-12-19 21:52:39 +01:00

25 lines
785 B
Rust

#![forbid(unsafe_code)]
#![cfg_attr(not(debug_assertions), deny(warnings))] // Forbid warnings in release builds
#![warn(clippy::all)]
pub mod app;
pub use app::EguiApp;
// ----------------------------------------------------------------------------
// When compiling for web:
#[cfg(target_arch = "wasm32")]
use wasm_bindgen::prelude::*;
/// This is the entry-point for all the web-assembly.
/// This is called once from the HTML.
/// It loads the app, installs some callbacks, then returns.
/// You can add more callbacks like this if you want to call in to your code.
#[cfg(target_arch = "wasm32")]
#[wasm_bindgen]
pub fn start(canvas_id: &str) -> Result<(), wasm_bindgen::JsValue> {
let app = EguiApp::default();
egui_web::start(canvas_id, Box::new(app))?;
Ok(())
}