検索

phrase: max: clip:
target: order:
Results of 1 - 2 of about 2 for meter (0.006 sec.)
テストケース: 単位を扱う - Rust By Example 日本語版 11228
Introduction 1. Hello World ❱ 1.1. コメント 1.2. フォーマットしてプリント ❱ 1.2.1. デバッグ 1.2. ... Mm {} /// `Length` is a type with phantom type parameter `Unit`, /// and is not generic over the length typ ... { // Specifies `one_foot` to have phantom type parameter `Inch`. // `one_foot`が幽霊型`Inch`を持つように明示 ... Length<Inch> = Length(12.0, PhantomData); // `one_meter` has phantom type parameter `Mm`. // `one_meter`が ... 幽霊型`Mm`を持つように明示する。 let one_meter: Length<Mm> = Length(1000.0, PhantomData); // `+` ...
https://man.plustar.jp/rust/example/generics/phantom/testcase_units.html - [similar]
継承(Derive) - Rust By Example 日本語版 7485
Introduction 1. Hello World ❱ 1.1. コメント 1.2. フォーマットしてプリント ❱ 1.2.1. デバッグ 1.2. ... 利用して値をフォーマットするためのトレイト // `Centimeters`, a tuple struct that can be compared // `Centime ... になる #[derive(PartialEq, PartialOrd)] struct Centimeters(f64); // `Inches`, a tuple struct that can be pri ... bug)] struct Inches(i32); impl Inches { fn to_centimeters(&self) -> Centimeters { let &Inches(inches) = sel ... f; Centimeters(inches as f64 * 2.54) } } // `Seconds`, a tuple s ...
https://man.plustar.jp/rust/example/trait/derive.html - [similar]
PREV 1 NEXT