anyhow:基于std的柔性混凝土错误类型

时间:2021-05-13 10:16:17
【文件属性】:
文件名称:anyhow:基于std的柔性混凝土错误类型
文件大小:45KB
文件格式:ZIP
更新时间:2021-05-13 10:16:17
Rust 无论如何\ _(°ペ)_ /¯ 该库提供 ,它是基于特征对象的错误类型,可在Rust应用程序中轻松进行惯用的错误处理。 [ dependencies ] anyhow = " 1.0 " 编译器支持:需要rustc 1.34+ 细节 使用Result或等效地anyhow::Result作为任何易失函数的返回类型。 在函数内,使用? 轻松传播实现std::error::Error特性的任何错误。 use anyhow :: Result ; fn get_cluster_info () -> Result { let config = std :: fs :: read_to_string ( "cluster.json" )?; let map: ClusterMap = serde_json ::
【文件预览】:
anyhow-master
----LICENSE-MIT(1023B)
----.clippy.toml(16B)
----Cargo.toml(811B)
----.github()
--------workflows()
----src()
--------context.rs(4KB)
--------error.rs(33KB)
--------macros.rs(5KB)
--------wrapper.rs(2KB)
--------ptr.rs(3KB)
--------backtrace.rs(13KB)
--------chain.rs(2KB)
--------lib.rs(20KB)
--------fmt.rs(4KB)
--------kind.rs(3KB)
----LICENSE-APACHE(11KB)
----build.rs(2KB)
----README.md(7KB)
----tests()
--------common()
--------drop()
--------test_ffi.rs(385B)
--------ui()
--------test_autotrait.rs(197B)
--------test_convert.rs(577B)
--------test_backtrace.rs(218B)
--------test_downcast.rs(3KB)
--------test_source.rs(1KB)
--------compiletest.rs(166B)
--------test_macros.rs(942B)
--------test_chain.rs(1KB)
--------test_context.rs(3KB)
--------test_fmt.rs(2KB)
--------test_repr.rs(589B)
--------test_boxed.rs(935B)
----.gitignore(30B)

网友评论