検索

phrase: max: clip:
target: order:
Results of 61 - 70 of about 148 for println (0.053 sec.)
トレイト - Rust By Example 日本語版 5714
Introduction 1. Hello World ❱ 1.1. コメント 1.2. フォーマットしてプリント ❱ 1.2.1. デバッグ 1.2. ... ルトの挙動を定義することもできる。 fn talk(&self) { println!("{} says {}", self.name(), self.noise()); } } imp ... その型のトレイトメソッドを // 使用することができる。 println!("{} is already naked...", self.name()); } else { ... t contemplation. // 例えば、静かに熟考させてみる。 println!("{} pauses briefly... {}", self.name, self.noise( ...
https://man.plustar.jp/rust/example/trait.html - [similar]
Option と unwrap - Rust By Example 日本語版 5667
Introduction 1. Hello World ❱ 1.1. コメント 1.2. フォーマットしてプリント ❱ 1.2.1. デバッグ 1.2. ... n for each case. match drink { Some("lemonade") => println!("Yuck! Too sugary."), Some(inner) => println!("{} ... ? How nice.", inner), None => println!("No drink? Oh well."), } } // Others will `panic` ... f inside == "lemonade" { panic!("AAAaaaaa!!!!"); } println!("I love {}s!!!!!", inside); } fn main() { let wat ...
https://man.plustar.jp/rust/example/error/option_unwrap.html - [similar]
Resultのmap - Rust By Example 日本語版 5667
Introduction 1. Hello World ❱ 1.1. コメント 1.2. フォーマットしてプリント ❱ 1.2.1. デバッグ 1.2. ... ult<i32, ParseIntError>) { match result { Ok(n) => println!("n is {}", n), Err(e) => println!("Error: {}", e) ... ult<i32, ParseIntError>) { match result { Ok(n) => println!("n is {}", n), Err(e) => println!("Error: {}", e) ...
https://man.plustar.jp/rust/example/error/result/result_map.html - [similar]
Result - Rust By Example 日本語版 5667
Introduction 1. Hello World ❱ 1.1. コメント 1.2. フォーマットしてプリント ❱ 1.2.1. デバッグ 1.2. ... er } fn main() { let twenty = multiply("10", "2"); println!("double is {}", twenty); let tt = multiply("t", " ... 2"); println!("double is {}", tt); } 失敗例では、 parse() がエラ ... n 関数は以下のような形になるでしょう。 fn main() { println!("Hello World!"); } 一方 main で Result をリターン ... Ok(number) => number, Err(e) => return Err(e), }; println!("{}", number); Ok(()) } 関連キーワード: Result , ...
https://man.plustar.jp/rust/example/error/result.html - [similar]
ポインタとref - Rust By Example 日本語版 5667
Introduction 1. Hello World ❱ 1.1. コメント 1.2. フォーマットしてプリント ❱ 1.2.1. デバッグ 1.2. ... `i32`が`val`にアサインされることがわかる。 &val => println!("Got a value via destructuring: {:?}", val), } // ... の前にデリファレンスする。 match *reference { val => println!("Got a value via dereferencing: {:?}", val), } // ... 使用してリファレンスを作成。 match value { ref r => println!("Got a reference to a value: {:?}", r), } // Use ... するためにはデリファレンスする必要がある。 *m += 10; println!("We added 10. `mut_value`: {:?}", m); }, } } See ...
https://man.plustar.jp/rust/example/flow_control/match/destructuring/destructure... - [similar]
Iterator::find - Rust By Example 日本語版 5667
Introduction 1. Hello World ❱ 1.1. コメント 1.2. フォーマットしてプリント ❱ 1.2.1. デバッグ 1.2. ... ァレンスは`&&i32`となる。`i32`へとデストラクトする。 println!("Find 2 in vec1: {:?}", iter .find(|&&x| x == 2)) ... // `into_iter`の場合は`&i32`が要素のリファレンス。 println!("Find 2 in vec2: {:?}", into_iter.find(| &x| x == ... &i32` // 配列に対する`iter`も`&i32`を`yield`する。 println!("Find 2 in array1: {:?}", array1.iter() .find(|&& ... `into_iter()`を使うと例外的に`&i32`を`yield`する。 println!("Find 2 in array2: {:?}", array2.into_iter().find ...
https://man.plustar.jp/rust/example/fn/closures/closure_examples/iter_find.html - [similar]
捕捉時の型推論 - Rust By Example 日本語版 5667
Introduction 1. Hello World ❱ 1.1. コメント 1.2. フォーマットしてプリント ❱ 1.2.1. デバッグ 1.2. ... ires `Fn`. // `greeting`は参照なので、`Fn`が必要。 println!("I said {}.", greeting); // Mutation forces `fare ... FnMut` // が必要になる。 farewell.push_str("!!!"); println!("Then I screamed {}.", farewell); println!("Now I ... `apply_to_3`'s trait bound let double = |x| 2 * x; println!("3 doubled: {}", apply_to_3(double)); } 参照 std: ...
https://man.plustar.jp/rust/example/fn/closures/input_parameters.html - [similar]
関連型が必要になる状況 - Rust By Example 日本語版 5667
Introduction 1. Hello World ❱ 1.1. コメント 1.2. フォーマットしてプリント ❱ 1.2.1. デバッグ 1.2. ... 10; let container = Container(number_1, number_2); println!("Does container contain {} and {}: {}", &number_1 ... mber_2, container.contains(&number_1, &number_2)); println!("First number: {}", container.first()); println!( ... "Last number: {}", container.last()); println!("The difference is: {}", difference(&container)); ...
https://man.plustar.jp/rust/example/generics/assoc_items/the_problem.html - [similar]
関連型 - Rust By Example 日本語版 5667
Introduction 1. Hello World ❱ 1.1. コメント 1.2. フォーマットしてプリント ❱ 1.2.1. デバッグ 1.2. ... 10; let container = Container(number_1, number_2); println!("Does container contain {} and {}: {}", &number_1 ... mber_2, container.contains(&number_1, &number_2)); println!("First number: {}", container.first()); println!( ... "Last number: {}", container.last()); println!("The difference is: {}", difference(&container)); ...
https://man.plustar.jp/rust/example/generics/assoc_items/types.html - [similar]
ジェネリック境界 - Rust By Example 日本語版 5667
Introduction 1. Hello World ❱ 1.1. コメント 1.2. フォーマットしてプリント ❱ 1.2.1. デバッグ 1.2. ... `という関数を定義。 fn printer<T: Display>(t: T) { println!("{}", t); } 境界は、ジェネリクスを全ての型ではなく ... の関数は動作する。 fn print_debug<T: Debug>(t: &T) { println!("{:?}", t); } // `T` must implement `HasArea`. An ... ngth: 3.0, height: 4.0 }; print_debug(&rectangle); println!("Area: {}", area(&rectangle)); //print_debug(&_tr ... iangle); //println!("Area: {}", area(&_triangle)); // ^ TODO: Try unc ...
https://man.plustar.jp/rust/example/generics/bounds.html - [similar]
PREV 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 NEXT