検索
Results of 91 - 100 of about 193 for let (0.075 sec.)
- for と range - Rust By Example 日本語版 5204
- Introduction 1. Hello World ❱ 1.1. コメント 1.2. フォーマットしてプリント ❱ 1.2.1. デバッグ 1.2.
...
構造体 8.5.2. ガード 8.5.3. バインディング 8.6. if let 8.7. while let 9. 関数 ❱ 9.1. メソッド 9.2. クロー...
の実行後もコレクションを再利用できます。 fn main() { let names = vec!["Bob", "Frank", "Ferris"]; for name i...
"There is a rustacean among us!"), // TODO ^ Try deleting the & and matching just "Ferris" _ => println!(...
レクションを再利用することはできません。 fn main() { let names = vec!["Bob", "Frank", "Ferris"]; for name i...
- https://man.plustar.jp/rust/example/flow_control/for.html - [similar]
- ジェネリック境界 - Rust By Example 日本語版 5204
- Introduction 1. Hello World ❱ 1.1. コメント 1.2. フォーマットしてプリント ❱ 1.2.1. デバッグ 1.2.
...
構造体 8.5.2. ガード 8.5.3. バインディング 8.6. if let 8.7. while let 9. 関数 ❱ 9.1. メソッド 9.2. クロー...
`を実装していないため、この特殊化 // は失敗します。 let s = S(vec![1]); 境界のもう一つの効果は、ジェネリッ...
T: HasArea>(t: &T) -> f64 { t.area() } fn main() { let rectangle = Rectangle { length: 3.0, height: 4.0 }...
; let _triangle = Triangle { length: 3.0, height: 4.0 };...
- https://man.plustar.jp/rust/example/generics/bounds.html - [similar]
- 明示的アノテーション - Rust By Example 日本語版 5204
- Introduction 1. Hello World ❱ 1.1. コメント 1.2. フォーマットしてプリント ❱ 1.2.1. デバッグ 1.2.
...
構造体 8.5.2. ガード 8.5.3. バインディング 8.6. if let 8.7. while let 9. 関数 ❱ 9.1. メソッド 9.2. クロー...
パラメータ`'a`を持つ関数。 fn failed_borrow<'a>() { let _x = 12; // ERROR: `_x` does not live long enough...
// エラー: `_x`の寿命が短すぎる。 let y: &'a i32 = &_x; // Attempting to use the lifetim...
be borrowed below. // 下で借用するための変数を作成 let (four, nine) = (4, 9); // Borrows (`&`) of both va...
- https://man.plustar.jp/rust/example/scope/lifetime/explicit.html - [similar]
- イテレータ - Rust By Example 日本語版 5204
- Introduction 1. Hello World ❱ 1.1. コメント 1.2. フォーマットしてプリント ❱ 1.2.1. デバッグ 1.2.
...
構造体 8.5.2. ガード 8.5.3. バインディング 8.6. if let 8.7. while let 9. 関数 ❱ 9.1. メソッド 9.2. クロー...
を返す。 fn next(&mut self) -> Option<Self::Item> { let new_next = self.curr + self.next; self.curr = self...
2. // `0..3`は0, 1, 2をジェネレートする`Iterator` let mut sequence = 0..3; println!("Four consecutive `n...
bonacci().skip(4).take(4) { println!("> {}", i); } let array = [1u32, 3, 3, 7]; // The `iter` method prod...
- https://man.plustar.jp/rust/example/trait/iter.html - [similar]
- TryFromおよびTryInto - Rust By Example 日本語版 5149
- Introduction 1. Hello World ❱ 1.1. コメント 1.2. フォーマットしてプリント ❱ 1.2.1. デバッグ 1.2.
...
構造体 8.5.2. ガード 8.5.3. バインディング 8.6. if let 8.7. while let 9. 関数 ❱ 9.1. メソッド 9.2. クロー...
_eq!(EvenNumber::try_from(5), Err(())); // TryInto let result: Result<EvenNumber, ()> = 8i32.try_into();...
assert_eq!(result, Ok(EvenNumber(8))); let result: Result<EvenNumber, ()> = 5i32.try_into();...
- https://man.plustar.jp/rust/example/conversion/try_from_try_into.html - [similar]
- loop - Rust By Example 日本語版 5149
- Introduction 1. Hello World ❱ 1.1. コメント 1.2. フォーマットしてプリント ❱ 1.2.1. デバッグ 1.2.
...
構造体 8.5.2. ガード 8.5.3. バインディング 8.6. if let 8.7. while let 9. 関数 ❱ 9.1. メソッド 9.2. クロー...
これは無限ループを作成するのに使用します。 訳注: while True と同じですが、ループのたびに条件を確認しないた...
プに移るときは continue が使用できます。 fn main() { let mut count = 0u32; println!("Let's count until infi...
- https://man.plustar.jp/rust/example/flow_control/loop.html - [similar]
- ミュータビリティ - Rust By Example 日本語版 5149
- Introduction 1. Hello World ❱ 1.1. コメント 1.2. フォーマットしてプリント ❱ 1.2.1. デバッグ 1.2.
...
構造体 8.5.2. ガード 8.5.3. バインディング 8.6. if let 8.7. while let 9. 関数 ❱ 9.1. メソッド 9.2. クロー...
ティは所有権を移譲した際に変更できます。 fn main() { let immutable_box = Box::new(5u32); println!("immutabl...
* する、同時に所有権とミュータビリティを変更する。 let mut mutable_box = immutable_box; println!("mutable...
- https://man.plustar.jp/rust/example/scope/move/mut.html - [similar]
- Partial moves - Rust By Example 日本語版 5149
- Introduction 1. Hello World ❱ 1.1. コメント 1.2. フォーマットしてプリント ❱ 1.2.1. デバッグ 1.2.
...
構造体 8.5.2. ガード 8.5.3. バインディング 8.6. if let 8.7. while let 9. 関数 ❱ 9.1. メソッド 9.2. クロー...
e(Debug)] struct Person { name: String, age: u8, } let person = Person { name: String::from("Alice"), age...
e` is moved out of person, but `age` is referenced let Person { name, ref age } = person; println!("The p...
- https://man.plustar.jp/rust/example/scope/move/partial_move.html - [similar]
- dropの延期 - Rust By Example 日本語版 5149
- Introduction 1. Hello World ❱ 1.1. コメント 1.2. フォーマットしてプリント ❱ 1.2.1. デバッグ 1.2.
...
構造体 8.5.2. ガード 8.5.3. バインディング 8.6. if let 8.7. while let 9. 関数 ❱ 9.1. メソッド 9.2. クロー...
xitStatus . use std::process::Command; fn main() { let mut child = Command::new("sleep").arg("5").spawn()...
.unwrap(); let _result = child.wait().unwrap(); println!("reached...
- https://man.plustar.jp/rust/example/std_misc/process/wait.html - [similar]
- 値の凍結 - Rust By Example 日本語版 5149
- Introduction 1. Hello World ❱ 1.1. コメント 1.2. フォーマットしてプリント ❱ 1.2.1. デバッグ 1.2.
...
構造体 8.5.2. ガード 8.5.3. バインディング 8.6. if let 8.7. while let 9. 関数 ❱ 9.1. メソッド 9.2. クロー...
縛がスコープ外になるまで変更できません。 fn main() { let mut _mutable_integer = 7i32; { // Shadowing by imm...
ミュータブルな`_mutable_integer`でシャドーイングする let _mutable_integer = _mutable_integer; // Error! `_m...
- https://man.plustar.jp/rust/example/variable_bindings/freeze.html - [similar]