Search CTRL + K

Rust Library Recommendation

异步运行时

日志、遥测

命令行参数

配置管理

错误处理

序列化与反序列化

ORM

工具

缓存

大数据

后端网络服务


Help rust error handling

Reply from rickyman20:[2]

  • Libraries should always use thiserror or something similar, but definitely never anyhow unless for user-passed functions (and even that is questionable)
  • Binaries are usually better served by anyhow
  • If you have a very complex binary, it's useful for use thiserror for error types within the modules of your binary, and then use anyhow in main specifically, so you can just ? every error and get them printing
Getting started with Tracing

The tracing crate provides the API we will use to emit traces. The tracing-subscriber crate provides some basic utilities for forwarding those traces to external listeners (e.g., stdout).[3]


  1. https://web-frameworks-benchmark.netlify.app/result?l=rust ↩︎

  2. https://www.reddit.com/r/learnrust/comments/10hcgbm/comment/j59o9x4/?utm_source=share&utm_medium=web2x&context=3 ↩︎

  3. https://tokio.rs/tokio/topics/tracing#setup ↩︎