検索

phrase: max: clip:
target: order:
Results of 1 - 10 of about 193 for unwrap (0.023 sec.)
Option と unwrap - Rust By Example 日本語版 13689
Introduction 1. Hello World ❱ 1.1. コメント 1.2. フォーマットしてプリント ❱ 1.2.1. デバッグ 1.2. ... . エラーハンドリング ❱ 18.1. panic 18.2. Option と unwrap ❱ 18.2.1. ?によるOptionのアンパック 18.2.2. Combin ... t Coal Navy Ayu Rust By Example 日本語版 Option と unwrap 以前の例では、甘いレモネードを飲んだ際に panic を呼 ... れらは match を用いて明示的に扱うこともできますし、 unwrap で暗黙に処理することもできます。後者は Some の中の ... カスタマイズできることに触れておきましょう。これは( unwrap をそのまま用いた場合よりも)内容が理解しやすいエラ ...
https://man.plustar.jp/rust/example/error/option_unwrap.html - [similar]
ファイルシステムとのやり取り - Rust By Example 日本語版 13135
Introduction 1. Hello World ❱ 1.1. コメント 1.2. フォーマットしてプリント ❱ 1.2.1. デバッグ 1.2. ... . エラーハンドリング ❱ 18.1. panic 18.2. Option と unwrap ❱ 18.2.1. ?によるOptionのアンパック 18.2.2. Combin ... // The previous match can be simplified using the `unwrap_or_else` method // 上のmatchは`unwrap_or_else`をメ ... 簡略化できる。 echo("hello", &Path::new("a/b.txt")).unwrap_or_else(|why| { println!("! {:?}", why.kind()); }) ... 返り値は`io::Result<()>` fs::create_dir_all("a/c/d").unwrap_or_else(|why| { println!("! {:?}", why.kind()); }) ...
https://man.plustar.jp/rust/example/std_misc/fs.html - [similar]
Result - Rust By Example 日本語版 11114
Introduction 1. Hello World ❱ 1.1. コメント 1.2. フォーマットしてプリント ❱ 1.2.1. デバッグ 1.2. ... . エラーハンドリング ❱ 18.1. panic 18.2. Option と unwrap ❱ 18.2.1. ?によるOptionのアンパック 18.2.2. Combin ... と同様、 Result は多くのメソッドを持ちます。例えば unwrap() は、 T もしくは panic をもたらします。エラーハン ... ond_number_str: &str) -> i32 { // Let's try using `unwrap()` to get the number out. Will it bite us? // `unw ... let first_number = first_number_str.parse::<i32>().unwrap(); let second_number = second_number_str.parse::<i ...
https://man.plustar.jp/rust/example/error/result.html - [similar]
パイプ - Rust By Example 日本語版 8724
Introduction 1. Hello World ❱ 1.1. コメント 1.2. フォーマットしてプリント ❱ 1.2.1. デバッグ 1.2. ... . エラーハンドリング ❱ 18.1. panic 18.2. Option と unwrap ❱ 18.2.1. ?によるOptionのアンパック 18.2.2. Combin ... w this instance // must have one, we can directly `unwrap` it. // `stdin`は`Option<ChildStdin>`型を持つが、今 ... 回は値を持っていることが // 確かなので、いきなり`unwrap`してしまってよい。 match process.stdin.unwrap().wr ... eld also has type `Option<ChildStdout>` so must be unwrapped. // `stdout`フィールドも`Option<ChildStdout>`型 ...
https://man.plustar.jp/rust/example/std_misc/process/pipe.html - [similar]
複数のエラー型 - Rust By Example 日本語版 7996
Introduction 1. Hello World ❱ 1.1. コメント 1.2. フォーマットしてプリント ❱ 1.2.1. デバッグ 1.2. ... . エラーハンドリング ❱ 18.1. panic 18.2. Option と unwrap ❱ 18.2.1. ?によるOptionのアンパック 18.2.2. Combin ... く、かつ連携しやすく管理したいです。 以下のコードは unwrap の2つのインスタンスが異なるエラー型を生成します。 ... t(vec: Vec<&str>) -> i32 { let first = vec.first().unwrap(); // Generate error 1 // エラー1の生成 2 * first. ... parse::<i32>().unwrap() // Generate error 2 // エラー2の生成 } fn main() ...
https://man.plustar.jp/rust/example/error/multiple_error_types.html - [similar]
?の他の活用法 - Rust By Example 日本語版 7811
Introduction 1. Hello World ❱ 1.1. コメント 1.2. フォーマットしてプリント ❱ 1.2.1. デバッグ 1.2. ... . エラーハンドリング ❱ 18.1. panic 18.2. Option と unwrap ❱ 18.2.1. ?によるOptionのアンパック 18.2.2. Combin ... せん。ただその代わり、 ? なら使えます。 ? の挙動は、 unwrap または return Err(err) として説明されていました。こ ... れはほぼ正解で、本当は unwrap 、もしくは return Err(From::from(err)) という意味が ... c と比べ、リターン型が Result であることを除けば、 unwrap の呼び出しを ? で置き換えたものに非常に似ています。 ...
https://man.plustar.jp/rust/example/error/multiple_error_types/reenter_question_... - [similar]
?の導入 - Rust By Example 日本語版 7811
Introduction 1. Hello World ❱ 1.1. コメント 1.2. フォーマットしてプリント ❱ 1.2.1. デバッグ 1.2. ... . エラーハンドリング ❱ 18.1. panic 18.2. Option と unwrap ❱ 18.2.1. ?によるOptionのアンパック 18.2.2. Combin ... 日本語版 ? の導入 時には panic の可能性を無視して、 unwrap のシンプルさを活用したいこともあるでしょう。今まで ...unwrap は、値を 取り出す ためだけであろうとも、ネストを深 ... Err に対して panic するより return するという点で unwrap と同等です。コンビネータを使った以前の例をどれだけ ...
https://man.plustar.jp/rust/example/error/result/enter_question_mark.html - [similar]
Documentation testing - Rust By Example 日本語版 7811
Introduction 1. Hello World ❱ 1.1. コメント 1.2. フォーマットしてプリント ❱ 1.2.1. デバッグ 1.2. ... . エラーハンドリング ❱ 18.1. panic 18.2. Option と unwrap ❱ 18.2.1. ?によるOptionのアンパック 18.2.2. Combin ... try_main() -> Result<(), ErrorType> , hide it and unwrap it in hidden main . Sounds complicated? Here's an ... /// # } /// # fn main() { // starting main that'll unwrap() /// # try_main().unwrap(); // calling try_main a ... nd unwrapping /// # // so that test will panic in case of er ...
https://man.plustar.jp/rust/example/testing/doc_testing.html - [similar]
dropの延期 - Rust By Example 日本語版 7257
Introduction 1. Hello World ❱ 1.1. コメント 1.2. フォーマットしてプリント ❱ 1.2.1. デバッグ 1.2. ... . エラーハンドリング ❱ 18.1. panic 18.2. Option と unwrap ❱ 18.2.1. ?によるOptionのアンパック 18.2.2. Combin ... mut child = Command::new("sleep").arg("5").spawn().unwrap(); let _result = child.wait().unwrap(); println!(" ...
https://man.plustar.jp/rust/example/std_misc/process/wait.html - [similar]
Stringとの型変換 - Rust By Example 日本語版 7073
Introduction 1. Hello World ❱ 1.1. コメント 1.2. フォーマットしてプリント ❱ 1.2.1. デバッグ 1.2. ... . エラーハンドリング ❱ 18.1. panic 18.2. Option と unwrap ❱ 18.2.1. ?によるOptionのアンパック 18.2.2. Combin ... だけです。 fn main() { let parsed: i32 = "5".parse().unwrap(); let turbo_parsed = "10".parse::<i32>().unwrap() ...
https://man.plustar.jp/rust/example/conversion/string.html - [similar]
PREV 1 2 3 4 5 6 7 8 9 10 NEXT