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