Skip to content

Conversation

@KaiTomotake
Copy link
Member

@KaiTomotake KaiTomotake commented Jan 18, 2026

概要

anyモジュールのフォルダーにTypeId.mdを追加

変更内容

  • anyモジュールのフォルダーにTypeId.mdを追加

チェックリスト

  • [] 作業中 (ドラフトPR)

  • サポートしているバージョンを明記した
  • ローカルで mdbook build を実行して確認した
  • modlist.mdを更新した(モジュール追加時)
  • SUMMARY.mdを更新した(モジュール追加時)
  • CONTRIBUTING.md のルールに従っている
  • ライセンス/著作権に問題がない

anyモジュールのフォルダーにTypeId.mdを追加
TypeId構造体のリファレンスを追加
@KaiTomotake KaiTomotake marked this pull request as ready for review January 20, 2026 11:45
@KaiTomotake KaiTomotake requested a review from hinshiba January 20, 2026 11:45
@hinshiba
Copy link
Member

hinshiba commented Jan 21, 2026

レビューをもう少しお待ちください.

Copy link
Member

@hinshiba hinshiba left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

貢献ありがとうございます.
Danger of Improper VarianceとExamplesについては確認お願いします.
他はこだわりがあるなら,そちらでもいいかなと考えています.

## 解説

型に対するグローバルに一意な識別子を提供する構造体。
不透明なオブジェクトであるため内部を直接見ることはできないが、cloneやdebugといった基本的な操作は可能である。
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

不透明というのは日本語として不自然な気がします.
内部が隠蔽されているオブジェクト
とかがより実態に即していると思いますがどうでしょうか?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

不透明型というプログラミング用語があるくらいなので大丈夫だと思います。

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

そうなんですか?
ちょっと調べた限りでは見当たらなかったので,例を示していただけると助かります.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

それはIBMのinfomix-serversの英語版の翻訳で使われているだけだと思うのですが......

不透明 (OPAQUE) 型の内部構造はデータベース サーバに通知されません

他にヒットするものもyahoo知恵袋,qiita, zennが1つずつしかなく,それもpublicなのかprivateなのかという話だと思っています.不透明な型という表現も散見されますが,隠蔽が定着しているので別に新しい表現でなくてもいいような気もしています.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

なるほど、私の調査不足のようですね。書き直します


現在、`TypeId`は`'static`制約を満たすもののみ利用できるが、これは将来解除される可能性がある。

また、`Hash`や`Ord`、`PartialOrd`を実装しているが、ハッシュ値や順序はRustのリリースごとに違うため、これらに依存した設計は避けるべきである。
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

意図が入っていますが,こちらの方がいいと思われます.

現在、`TypeId`は`'static`制約を満たすもののみ利用できるが、これは将来解除される可能性がある。

また、`Hash`や`Ord`、`PartialOrd`を実装しているが、ハッシュ値や順序はRustのリリースごとに違うため、これらに依存した設計は避けるべきである。

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Danger of Improper VarianceとExamplesが省略されています.
これは閲覧者が公式には追加の記述があることを一時的にでも書いておくことが親切かと思われます.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

見逃していました。追加します

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants