Skip to main content

Error

Derive Macro Error 

Source
#[derive(Error)]
{
    // Attributes available to this derive:
    #[error]
    #[from]
    #[source]
}
Expand description

Re-export the derive macro so users can use nexcore_error::Error; Derive Display and std::error::Error for an enum or struct.

§Attributes

  • #[error("format string")] — Display format for the variant/struct
  • #[error(transparent)] — Forward Display and source to inner type
  • #[from] on a field — Generate From<FieldType> impl
  • #[source] on a field — Use as Error::source() return value