pub struct Error(eframe::Error); pub fn gui() -> anyhow::Result<()> { let options = eframe::NativeOptions::default(); eframe::run_native( "Encoded Message", options, Box::new(|_cc| Ok(Box::::new( Default::default() ))) ).map_err(crate::Error::from)?; Ok(()) } #[derive(Default)] struct Gui { message: Option, circle_length: Option, } impl eframe::App for Gui { fn update(&mut self, ctx: &egui::Context, _frame: &mut eframe::Frame) { egui::CentralPanel::default().show(ctx, |ui| { //TODO: UI (on unfocus update values) // Message Content input // start shift input // circle length input // generate button (if pressed, generate plot with details) }); } } impl From for Error { fn from(err: eframe::Error) -> Self { Error(err) } } impl From for anyhow::Error { fn from(err: Error) -> Self { anyhow::anyhow!(err.0.to_string()) } }