<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>syu-m-5151</author_name>
  <author_url>https://blog.hatena.ne.jp/syu-m-5151/</author_url>
  <blog_title>じゃあ、おうちで学べる </blog_title>
  <blog_url>https://syu-m-5151.hatenablog.com/</blog_url>
  <categories>
    <anon>Rust</anon>
  </categories>
  <description>はじめに Rust で「ライブラリのエラー型をどう設計するか」は永遠のテーマです。素朴な答えは2つあります。 アプリケーションなら anyhow で済ませる ライブラリなら thiserror で型付きエラーを返す これは2026年でも変わりません。この記事は「ライブラリ向け」のほうの設計を、 #[non_exhaustive] を組み合わせて SemVer 互換を壊さない形で書く方法を扱います。 まず動くコード use std::num::ParseIntError; #[derive(Debug, thiserror::Error)] #[non_exhaustive] pub enum …</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fsyu-m-5151.hatenablog.com%2Fentry%2F2026%2F05%2F04%2F235804&quot; title=&quot;`thiserror` と `#[non_exhaustive]` で SemVer に強いエラー型を作る - じゃあ、おうちで学べる &quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url></image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2026-05-04 23:58:04</published>
  <title>`thiserror` と `#[non_exhaustive]` で SemVer に強いエラー型を作る</title>
  <type>rich</type>
  <url>https://syu-m-5151.hatenablog.com/entry/2026/05/04/235804</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
