検索
Results of 1 - 1 of about 1 for HasArea (0.000 sec.)
- ジェネリック境界 - Rust By Example 日本語版 9414
- Introduction 1. Hello World ❱ 1.1. コメント 1.2. フォーマットしてプリント ❱ 1.2.1. デバッグ 1.2.
...{:?}`を実装するトレイト use std::fmt::Debug; trait HasArea { fn area(&self) -> f64; } impl HasArea for Rectan...T) { println!("{:?}", t); } // `T` must implement `HasArea`. Any type which meets // the bound can access `Ha...sArea`'s function `area`. // 「`T`は`HasArea`を実装していなくてはならない」という境界条件を //...満たしていれば、`HasArea`の関数`area`にアクセスできる。 fn area<T: HasArea>... - https://man.plustar.jp/rust/example/generics/bounds.html - [similar]
PREV
1
NEXT