pub fn run_catch_error<F>(to_run: fn(Conn) -> F)Expand description
Run a function and panic on error
use embly::{
Error,
prelude::*,
};
async fn execute(mut conn: embly::Conn) -> Result<(), Error> {
conn.write_all(b"Hello\n")?;
let mut out = Vec::new();
conn.read_to_end(&mut out)?;
println!("{:?}", out);
Ok(())
}
fn main() {
embly::run_catch_error(execute);
}