検索
Results of 1 - 7 of about 7 for Pair (0.003 sec.)
- クローン - Rust By Example 日本語版 13159
- Introduction 1. Hello World ❱ 1.1. コメント 1.2. フォーマットしてプリント ❱ 1.2.1. デバッグ 1.2.
...資源として持つタプル #[derive(Clone, Debug)] struct Pair(Box<i32>, Box<i32>); fn main() { // Instantiate `U...intln!("copy: {:?}", copied_unit); // Instantiate `Pair` // `Pair`のインスタンスを作成 let pair = Pair(Box...::new(1), Box::new(2)); println!("original: {:?}", pair); // Move `pair` into `moved_pair`, moves resource...s // `pair`を`moved_pair`に移動、資源は移動(`move`)する。 let... - https://man.plustar.jp/rust/example/trait/clone.html - [similar]
- メソッド - Rust By Example 日本語版 9469
- Introduction 1. Hello World ❱ 1.1. コメント 1.2. フォーマットしてプリント ❱ 1.2.1. デバッグ 1.2.
...p2.x += x; self.p1.y += y; self.p2.y += y; } } // `Pair` owns resources: two heap allocated integers // `P...air`はヒープ上の整数を2つ保持する。 struct Pair(Box<i32>, Box<i32>); impl Pair { // This method "c...// Destructure `self` // `self`をデストラクト let Pair(first, second) = self; println!("Destroying Pair({...ソッドを呼び出せる。 square.translate(1.0, 1.0); let pair = Pair(Box::new(1), Box::new(2)); pair.destroy();... - https://man.plustar.jp/rust/example/fn/methods.html - [similar]
- Rust By Example 日本語版 8833
- Introduction 1. Hello World ❱ 1.1. コメント 1.2. フォーマットしてプリント ❱ 1.2.1. デバッグ 1.2.
...関数の引数及び返り値として使用している。 fn reverse(pair: (i32, bool)) -> (bool, i32) { // `let` can be use...数に束縛することができる。 let (integer, boolean) = pair; (boolean, integer) } // The following struct is f...メントを外して、コンパイルエラーになることを確認 let pair = (1, true); println!("pair is {:?}", pair); print...ln!("the reversed pair is {:?}", reverse(pair)); // To create one element... - https://man.plustar.jp/rust/example/print.html - [similar]
- 構造体 - Rust By Example 日本語版 8778
- Introduction 1. Hello World ❱ 1.1. コメント 1.2. フォーマットしてプリント ❱ 1.2.1. デバッグ 1.2.
...ット struct Unit; // A tuple struct // タプル struct Pair(i32, f32); // A struct with two fields // 2つのフィ...tiate a tuple struct // タプルをインスタンス化 let pair = Pair(1, 0.1); // Access the fields of a tuple st...ruct // タプルのフィールドにアクセス println!("pair contains {:?} and {:?}", pair.0, pair.1); // Destr...ucture a tuple struct // タプルをデストラクト let Pair(integer, decimal) = pair; println!("pair contains... - https://man.plustar.jp/rust/example/custom_types/structs.html - [similar]
- タプル - Rust By Example 日本語版 8288
- Introduction 1. Hello World ❱ 1.1. コメント 1.2. フォーマットしてプリント ❱ 1.2.1. デバッグ 1.2.
...関数の引数及び返り値として使用している。 fn reverse(pair: (i32, bool)) -> (bool, i32) { // `let` can be use...数に束縛することができる。 let (integer, boolean) = pair; (boolean, integer) } // The following struct is f...メントを外して、コンパイルエラーになることを確認 let pair = (1, true); println!("pair is {:?}", pair); print...ln!("the reversed pair is {:?}", reverse(pair)); // To create one element... - https://man.plustar.jp/rust/example/primitives/tuples.html - [similar]
- ガード - Rust By Example 日本語版 8051
- Introduction 1. Hello World ❱ 1.1. コメント 1.2. フォーマットしてプリント ❱ 1.2.1. デバッグ 1.2.
...guard ) を使用することができます。 fn main() { let pair = (2, -2); // TODO ^ Try different values for `pai...r` // TODO ^ `pair`の値を変更してみましょう。 println!("Tell me about...{:?}", pair); match pair { (x, y) if x == y => println!("These... - https://man.plustar.jp/rust/example/flow_control/match/guard.html - [similar]
- 文字列 - Rust By Example 日本語版 6979
- Introduction 1. Hello World ❱ 1.1. コメント 1.2. フォーマットしてプリント ❱ 1.2.1. デバッグ 1.2.
...str); // If you need quotes in a raw string, add a pair of #s let quotes = r#"And then I said: "There is n... - https://man.plustar.jp/rust/example/std/str.html - [similar]
PREV
1
NEXT