易于使用的 Rust 可选函数参数

时间:2021-06-28 19:12:58
【文件属性】:
文件名称:易于使用的 Rust 可选函数参数
文件大小:14KB
文件格式:ZIP
更新时间:2021-06-28 19:12:58
optargs OptArgs:Rust 函数的可选参数为任何函数启用可选参数:#[optargs::optfn]pubfnplot ( x:Vec , y:Option >, title:Option <&str >, xlabel:Option <&str >, ylabel:Option <&str >, legend:Option ) {}// can now call it with optional argumentsplot! ( x:vec! [1 ,2 ,3 ], y:vec! [1 ,2 ,3 ], title:"Awesome plot" , xlabel:"x axis" , ylabel:"y axis" );...或结构:#[derive(optargs::OptStruct)]pubstructScatter { x:Vec , y:Option<V
【文件预览】:
optargs-master
----.gitignore(27B)
----src()
--------lib.rs(1KB)
----optargs-macro()
--------.gitignore(19B)
--------src()
--------Cargo.toml(573B)
--------README.md(119B)
----notes()
--------ROADMAP.md(836B)
----Cargo.toml(602B)
----examples()
--------optstruct_demo.rs(169B)
--------optfn_demo.rs(1KB)
--------optstruct_reference.rs(890B)
--------optfn_reference.rs(2KB)
--------optfn_multiple_dyns.rs(122B)
----README.md(3KB)

网友评论