thiserror
The thiserror
crate provides macros to help avoid boilerplate when defining error types. It provides derive macros that assist in implementing From<T>
, Display
, and the Error
trait.
Speaker Notes
This slide should take about 5 minutes.
Error
導出マクロはthiserror
によって提供されます。このマクロには、エラー型を簡潔に定義するのに役立つ属性が数多く用意されています。#[error]
からのメッセージは、Display
トレイトを導出するために使用されます。- Note that the (
thiserror::
)Error
derive macro, while it has the effect of implementing the (std::error::
)Error
trait, is not the same this; traits and macros do not share a namespace.