検索

phrase: max: clip:
target: order:
Results of 1 - 10 of about 57 for mut (0.024 sec.)
Rust By Example 日本語版 14773
Introduction 1. Hello World ❱ 1.1. コメント 1.2. フォーマットしてプリント ❱ 1.2.1. デバッグ 1.2. ... シグネチャであることを要求します。 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { // Write strictly ... 。 impl fmt::Display for MinMax { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { // Use `self.numb ... impl fmt::Display for Point2D { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { // Customize so o ... >); impl fmt::Display for List { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { // Extract the va ...
https://man.plustar.jp/rust/example/print.html - [similar]
要素の捕捉 - Rust By Example 日本語版 11851
Introduction 1. Hello World ❱ 1.1. コメント 1.2. フォーマットしてプリント ❱ 1.2.1. デバッグ 1.2. ... ます。 リファレンス: &T ミュータブルなリファレンス: &mut T 値そのもの: T クロージャは出来る限りリファレンス ... ime. // // `println!` only requires arguments by immutable reference so it doesn't // impose anything mor ... をコールする。 print(); // `color` can be borrowed immutably again, because the closure only holds // an im ... や再借用が許可される。 let _color_moved = color; let mut count = 0; // A closure to increment `count` could ...
https://man.plustar.jp/rust/example/fn/closures/capture.html - [similar]
ポインタとref - Rust By Example 日本語版 10911
Introduction 1. Hello World ❱ 1.1. コメント 1.2. フォーマットしてプリント ❱ 1.2.1. デバッグ 1.2. ... ンスには * を用いる。 デストラクトには & , ref , ref mut を用いる。 fn main() { // Assign a reference of ty ... references // can be retrieved via `ref` and `ref mut`. // 同様にミュータブルな値の場合`ref mut`を使用す ... 場合と合わせてみていきましょう。 let value = 5; let mut mut_value = 6; // Use `ref` keyword to create a re ... t a reference to a value: {:?}", r), } // Use `ref mut` similarly. // 同様に`ref mut`を使用。 match mut_v ...
https://man.plustar.jp/rust/example/flow_control/match/destructuring/destructure... - [similar]
refパターン - Rust By Example 日本語版 10162
Introduction 1. Hello World ❱ 1.1. コメント 1.2. フォーマットしてプリント ❱ 1.2.1. デバッグ 1.2. ... の`x`フィールドへのコピーを返す。 *ref_to_x }; // A mutable copy of `point` // `point`へのミュータブルなコ ... ピー let mut mutable_point = point; { // `ref` can be paired wi ... th `mut` to take mutable references. // `ref`は`mut`ととも ... な参照を取ることもできる。 let Point { x: _, y: ref mut mut_ref_to_y } = mutable_point; // Mutate the `y` ...
https://man.plustar.jp/rust/example/scope/borrow/ref.html - [similar]
ファイルシステムとのやり取り - Rust By Example 日本語版 9031
Introduction 1. Hello World ❱ 1.1. コメント 1.2. フォーマットしてプリント ❱ 1.2.1. デバッグ 1.2. ... 実装 fn cat(path: &Path) -> io::Result<String> { let mut f = File::open(path)?; let mut s = String::new(); ... match f.read_to_string(&mut s) { Ok(_) => Ok(s), Err(e) => Err(e), } } // A si ... echo(s: &str, path: &Path) -> io::Result<()> { let mut f = File::create(path)?; f.write_all(s.as_bytes()) ... n: fn cat(path: &Path) -> io::Result<String> { let mut f = File::open(path)?; let mut s = String::new(); ...
https://man.plustar.jp/rust/example/std_misc/fs.html - [similar]
メソッド - Rust By Example 日本語版 8458
Introduction 1. Hello World ❱ 1.1. コメント 1.2. フォーマットしてプリント ❱ 1.2.1. デバッグ 1.2. ... } // This method requires the caller object to be mutable // `&mut self` desugars to `self: &mut Self` / ... ジェクトがミュータブルであることを // 必要とする。`&mut self`は`self: &mut Self`の糖衣構文である。 fn tran ... slate(&mut self, x: f64, y: f64) { self.p1.x += x; self.p2.x ... ntln!("Rectangle area: {}", rectangle.area()); let mut square = Rectangle { p1: Point::origin(), p2: Poin ...
https://man.plustar.jp/rust/example/fn/methods.html - [similar]
ミュータビリティ - Rust By Example 日本語版 8370
Introduction 1. Hello World ❱ 1.1. コメント 1.2. フォーマットしてプリント ❱ 1.2.1. デバッグ 1.2. ... 日本語版 ミュータビリティ ミュータブルなデータは &mut T でミュータブルに(変更可能な形で)借用することが ... を取る。 fn borrow_book(book: &Book) { println!("I immutably borrowed {} - {} edition", book.title, book.ye ... ar); } // This function takes a reference to a mutable book and changes `year` to 2014 // この関数はミ ... // `year`を2014へ変更する。 fn new_edition(book: &mut Book) { book.year = 2014; println!("I mutably borr ...
https://man.plustar.jp/rust/example/scope/borrow/mut.html - [similar]
Iterator::find - Rust By Example 日本語版 8282
Introduction 1. Hello World ❱ 1.1. コメント 1.2. フォーマットしてプリント ❱ 1.2.1. デバッグ 1.2. ... イテレートされる値の型 type Item; // `find` takes `&mut self` meaning the caller may be borrowed // and mo ... dified, but not consumed. // `find`は`&mut self`を取るため、イテレータを呼び出した値を借用し ... しますが、消費し尽くすことはありません。 fn find<P>(&mut self, predicate: P) -> Option<Self::Item> where // ... `FnMut` meaning any captured variable may at most be // m ...
https://man.plustar.jp/rust/example/fn/closures/closure_examples/iter_find.html - [similar]
for と range - Rust By Example 日本語版 8179
Introduction 1. Hello World ❱ 1.1. コメント 1.2. フォーマットしてプリント ❱ 1.2.1. デバッグ 1.2. ... はこれだけではありません。 into_iter 、 iter 、 iter_mut はいずれもコレクションのイテレータへの変換を行いま ... ", names); // FIXME ^ Comment out this line } iter_mut - この関数はコレクションの各要素をミュータブル(変 ... ションの要素をその場で変更できます。 fn main() { let mut names = vec!["Bob", "Frank", "Ferris"]; for name i ... n names.iter_mut() { *name = match name { &mut "Ferris" => "There i ...
https://man.plustar.jp/rust/example/flow_control/for.html - [similar]
DRY (Don't Repeat Yourself) - Rust By Example 日本語版 7900
Introduction 1. Hello World ❱ 1.1. コメント 1.2. フォーマットしてプリント ❱ 1.2.1. デバッグ 1.2. ... => { fn $func<T: $bound<T, Output=T> + Copy>(xs: &mut Vec<T>, ys: &Vec<T>) { assert_equal_len!(xs, ys, $ ... func, $op); for (x, y) in xs.iter_mut().zip(ys.iter()) { *x = $bound::$method(*x, *y); / ... #[test] fn $func() { for size in 0usize..10 { let mut x: Vec<_> = iter::repeat($x).take(size).collect(); ... er::repeat($z).take(size).collect(); super::$func(&mut x, &y); assert_eq!(x, z); } } }; } // Test `add_as ...
https://man.plustar.jp/rust/example/macros/dry.html - [similar]
PREV 1 2 3 4 5 6 NEXT