use rsciter::*; fn main() { if let Err(e) = try_main() { eprintln!("Error: {e}"); } else { println!("Ok!"); } } const HTML: &'static [u8] = br#"
"#; #[rsciter::asset] struct Object { path: String, flags: u64, } impl Drop for Object { fn drop(&mut self) { println!("Object dropped"); } } #[rsciter::asset] impl Object { pub fn update(&self, value: &str) -> UpdateRes { UpdateRes(format!( "Updating: {value} for {} with {}", self.path, self.flags )) } } struct UpdateRes(String); impl Drop for UpdateRes { fn drop(&mut self) { println!("UpdateRes dropped"); } } // If the struct itself does not have #[rsciter::asset] attribute, // it's enough to specify #[rsciter::asset(HasPassport)] for impl block #[rsciter::asset(HasPassport)] impl UpdateRes { pub fn message(&self) -> &str { &self.0 } } #[rsciter::asset] mod Db { use super::*; pub fn open(path: &str, flags: u64) -> Object { Object { path: path.into(), flags, } } } fn try_main() -> Result