検索
Results of 1 - 4 of about 4 for RHS (0.006 sec.)
- テストケース: 単位を扱う - Rust By Example 日本語版 12316
- Introduction 1. Hello World ❱ 1.1. コメント 1.2. フォーマットしてプリント ❱ 1.2.1. デバッグ 1.2.
...その場合 Add トレイトは以下のようになります。 訳注: RHSはRight Hand Side、つまりAdd( + )演算時の右辺のことで...す // This construction would impose: `Self + RHS = Output` // where RHS defaults to Self if not spe...plementation. // このように定義しておくと、`Self + RHS = Output`であることが保証され、 // かつ、impl時にR...合、デフォルトでSelfと同じに // なる。 pub trait Add<RHS = Self> { type Output; fn add(self, rhs: RHS) -> S... - https://man.plustar.jp/rust/example/generics/phantom/testcase_units.html - [similar]
- 演算子のオーバーロード - Rust By Example 日本語版 8802
- Introduction 1. Hello World ❱ 1.1. コメント 1.2. フォーマットしてプリント ❱ 1.2.1. デバッグ 1.2.
...we make `Add<Bar>` - the trait for addition with a RHS of type `Bar`. // The following block implements t...Bar> for Foo { type Output = FooBar; fn add(self, _rhs: Bar) -> FooBar { println!("> Foo.add(Bar) was cal...we make `Add<Foo>` - the trait for addition with a RHS of type `Foo`. // This block implements the operat...Foo> for Bar { type Output = BarFoo; fn add(self, _rhs: Foo) -> BarFoo { println!("> Bar.add(Foo) was cal... - https://man.plustar.jp/rust/example/trait/ops.html - [similar]
- 関数 - Rust By Example 日本語版 8451
- Introduction 1. Hello World ❱ 1.1. コメント 1.2. フォーマットしてプリント ❱ 1.2.1. デバッグ 1.2.
...ブーリアン型を返す関数 fn is_divisible_by(lhs: u32, rhs: u32) -> bool { // Corner case, early return // 例...外的な引数を受けた場合、早めに返す。 if rhs == 0 { return false; } // This is an expression, t...は式であり、`return`キーワードは必要ではない。 lhs % rhs == 0 } // Functions that "don't" return a value, a... - https://man.plustar.jp/rust/example/fn.html - [similar]
- Rust By Example 日本語版 7378
- Introduction 1. Hello World ❱ 1.1. コメント 1.2. フォーマットしてプリント ❱ 1.2.1. デバッグ 1.2.
...ブーリアン型を返す関数 fn is_divisible_by(lhs: u32, rhs: u32) -> bool { // Corner case, early return // 例...外的な引数を受けた場合、早めに返す。 if rhs == 0 { return false; } // This is an expression, t...は式であり、`return`キーワードは必要ではない。 lhs % rhs == 0 } // Functions that "don't" return a value, a... - https://man.plustar.jp/rust/example/print.html - [similar]
PREV
1
NEXT