fn main() { if let Err(e) = try_main() { eprintln!("Error: {e}"); } else { println!("Ok!"); } } const HTML: &'static [u8] = br#"
"#; // a single macro to export entire backend #[rsciter::asset_ns] mod Db { pub fn open(path: &str, flags: u64) -> Object { Object { path: path.into(), flags, } } pub struct Object { path: String, flags: u64, } impl Object { pub fn update(&self, value: &str) -> UpdateRes { UpdateRes(format!( "Updating: `{value}` for `{}` with `{}`", self.path, self.flags )) } } // UpdateRes might be private, as it used only inside the backend struct UpdateRes(String); impl UpdateRes { pub fn message(&self) -> &str { &self.0 } } } fn try_main() -> rsciter::Result