Quartz 5

Home

❯

notes

❯

From trait

From trait

Properties1
tagsrust/lang

Jun 28, 20261 min read

From<T> trait

impl From<変換元> for 変換先 {
    fn from(from: 変換元) -> 変換先 {
        // ...
    }
}

ある値への変換方法を定義するtrait, 逆は Into<T>, 自動で実装される

参考文献

  • From in std::convert - Rust
  • Rusts における From<T> とか Into<T> とかの考え方 - Qiita

Graph View

  • From<T> trait
  • 参考文献

Backlinks

  • MOC: 言語/型/コンパイラ

Created with Quartz v5.0.0 © 2026

  • GitHub
  • Discord Community