use lws_client::LwsVfsIns; use std::thread; #[tokio::main] async fn main() -> Result<(), Box> { let lws_ins = match LwsVfsIns::new("config.json").await { Ok(ins) => ins, Err(e) => { println!("Error creating lws server instance: {:?}", e); return Err(e); } }; println!("start hello process"); match lws_ins.hello().await { Err(e) => { println!("lws client instance hello err {:?}", e); return Err(e); } _ => {} } println!("start mount process"); let handle = thread::spawn(move ||{ match LwsVfsIns::mount(lws_ins) { Ok(_) => { Ok::(0) }, Err(e) => { println!("mount err {:?}", e); Ok::(-1) } } }); match handle.join() { Ok(_) => { Ok(()) }, Err(e) => { eprintln!("mount thread start err {:?}", e); Err(Box::new(std::io::Error::new(std::io::ErrorKind::Other, "mount fail"))) } } }