Module python_comm::use_m
source · Expand description
Usage
use python_comm::use_m::*;
use std::fs::File;
#[auto_func_name]
#[auto_func_name]
fn has_error(n: i32) -> Result<(), MoreError> {
File::open("not exist").m(m!(__func__))?;
Ok(())
}
fn main() {
if let Err(err) = has_error(0) {
println!("{}", err);
}
}Macros
- 用最短的代码引入文件名、行号
Structs
- 包含更多信息的 Error
Traits
- 给 Error 增加更多信息
Attribute Macros
- Create a local variable func = “xxx” in fn xxx()