{
  "id": "rust-thiserror-table",
  "kind": "table",
  "slug": "rust-thiserror",
  "iil_id": null,
  "note_url": "https://iinventedlight.com/library/notes/rust-thiserror/",
  "title": "thiserror derives std::error::Error with #[error], #[from], #[source] and transparent variants",
  "columns": [
    "name",
    "source",
    "detail"
  ],
  "rows": [
    {
      "name": "#[error(\"{var}\")]",
      "source": "docs.rs",
      "detail": "#[error(\"{0:?}\")]: generates a Display impl that interpolates fields"
    },
    {
      "name": "#[from]",
      "source": "docs.rs",
      "detail": "implies that the same field is #[source]"
    },
    {
      "name": "#[source]",
      "source": "docs.rs",
      "detail": "or a field named source: returned by the Error trait's source() method"
    },
    {
      "name": "#[error(transparent)]",
      "source": "docs.rs",
      "detail": "forwards the source and Display methods to an underlying error without an additional message"
    },
    {
      "name": "error(transparent)",
      "source": "docs.rs",
      "detail": "is appropriate for enums that need an \"anything else\" variant."
    }
  ],
  "related_slugs": [
    "rust-anyhow",
    "rust-error-handling-result",
    "rust-enums"
  ],
  "license": "CC-BY-4.0",
  "source_license": "MIT OR Apache-2.0 (docs.rs); MIT OR Apache-2.0 (dtolnay/thiserror (GitHub)); prose restates cited source lines in own words",
  "as_of": "2026-11-18",
  "status": "fill-draft-20261118",
  "note": "Restated from the note's GREEN sources; check those sources before relying on a value."
}