検索

phrase: max: clip:
target: order:
Results of 1 - 8 of about 8 for borrow (0.026 sec.)
RefCell<T>と内部可変性パターン - Rust 日本語版 13176
The Rust Programming Language 日本語版 まえがき はじめに 1. 事始め 1.1. インストール 1.2. Hello, ... 下のようなエラーが出るでしょう: error[E0596]: cannot borrow immutable local variable `x` as mutable (エラー: 不 ... ing this to `mut x` 3 | let y = &mut x; | ^ cannot borrow mutably ですが、メソッド内で値が自身を可変化するけ ... のテストには1つ問題があります: error[E0596]: cannot borrow immutable field `self.sent_messages` as mutable (エ ... rom(message)); | ^^^^^^^^^^^^^^^^^^ cannot mutably borrow immutable field send メソッドは self への不変参照を ...
https://man.plustar.jp/rust/book/ch15-05-interior-mutability.html - [similar]
参照と借用 - Rust 日本語版 10392
The Rust Programming Language 日本語版 まえがき はじめに 1. 事始め 1.1. インストール 1.2. Hello, ... ようと試みる これがエラーです: error[E0596]: cannot borrow immutable borrowed content `*some_string` as mutab ... e_string.push_str(", world"); | ^^^^^^^^^^^ cannot borrow as mutable 変数が標準で不変なのと全く同様に、参照も ... (file:///projects/ownership) error[E0499]: cannot borrow `s` as mutable more than once at a time (エラー: 一 ... 5:14 | 4 | let r1 = &mut s; | ------ first mutable borrow occurs here | (最初の可変な参照はここ) 5 | let r2 ...
https://man.plustar.jp/rust/book/ch04-02-references-and-borrowing.html - [similar]
循環参照は、メモリをリークすることもある - Rust 日本語版 9127
The Rust Programming Language 日本語版 まえがき はじめに 1. 事始め 1.1. インストール 1.2. Hello, ... ", b.tail()); if let Some(link) = a.tail() { *link.borrow_mut() = Rc::clone(&b); } // aを変更後のbの参照カウ ... link に配置します。 それから RefCell<Rc<List>> の borrow_mut メソッドを使用して中の値を Nil 値を持つ Rc<Lis ... = {:?} println!("leaf parent = {:?}", leaf.parent.borrow().upgrade()); let branch = Rc::new(Node { value: 5 ... ell::new(vec![Rc::clone(&leaf)]), }); *leaf.parent.borrow_mut() = Rc::downgrade(&branch); println!("leaf par ...
https://man.plustar.jp/rust/book/ch15-06-reference-cycles.html - [similar]
ベクタで値のリストを保持する - Rust 日本語版 8495
The Rust Programming Language 日本語版 まえがき はじめに 1. 事始め 1.1. インストール 1.2. Hello, ... プログラムに有効な参照がある場合、借用チェッカー (borrow checker) は、(第4章で解説しましたが)所有権と借用 ... file:///projects/collections) error[E0502]: cannot borrow `v` as mutable because it is also borrowed as immu ... main.rs:6:5 | 4 | let first = &v[0]; | - immutable borrow occurs here | (不変借用はここで発生しています) 5 | ... 6 | v.push(6); | ^^^^^^^^^ mutable borrow occurs here | (可変借用はここで発生しています) 7 | ...
https://man.plustar.jp/rust/book/ch08-01-vectors.html - [similar]
スライス型 - Rust 日本語版 8133
The Rust Programming Language 日本語版 まえがき はじめに 1. 事始め 1.1. インストール 1.2. Hello, ... (file:///projects/ownership) error[E0502]: cannot borrow `s` as mutable because it is also borrowed as immu ... 5 | 16 | let word = first_word(&s); | -- immutable borrow occurs here | (不変借用はここで発生しています) 17 ... | 18 | s.clear(); // error! | ^^^^^^^^^ mutable borrow occurs here | (可変借用はここで発生しています) 19 ... !("the first word is: {}", word); | ---- immutable borrow later used here (不変借用はその後ここで使われていま ...
https://man.plustar.jp/rust/book/ch04-03-slices.html - [similar]
Unsafe Rust - Rust 日本語版 7952
The Rust Programming Language 日本語版 まえがき はじめに 1. 事始め 1.1. インストール 1.2. Hello, ... みると、エラーになるでしょう。 error[E0499]: cannot borrow `*slice` as mutable more than once at a time (エラ ... -> | 6 | (&mut slice[..mid], | ----- first mutable borrow occurs here 7 | &mut slice[mid..]) | ^^^^^ second ... mutable borrow occurs here 8 | } | - first borrow ends here Rustの ...
https://man.plustar.jp/rust/book/ch19-01-unsafe-rust.html - [similar]
ライフタイムで参照を検証する - Rust 日本語版 7519
The Rust Programming Language 日本語版 まえがき はじめに 1. 事始め 1.1. インストール 1.2. Hello, ... 短すぎます) --> src/main.rs:7:17 | 7 | r = &x; | ^^ borrowed value does not live long enough | (借用された値の ... が短すぎます) 8 | } | - `x` dropped here while still borrowed | (`x`は借用されている間にここでドロップされまし ... た) 9 | 10 | println!("r: {}", r); | - borrow later used here | (その後、借用はここで使われていま ... ) | = help: this function's return type contains a borrowed value, but the signature does not say whether it ...
https://man.plustar.jp/rust/book/ch10-03-lifetime-syntax.html - [similar]
キーとそれに紐づいた値をハッシュマップに格納する - Rust 日本語版 7428
The Rust Programming Language 日本語版 まえがき はじめに 1. 事始め 1.1. インストール 1.2. Hello, ... そのロジックを自分で書くよりもはるかに綺麗な上に、borrow checkerとも親和性が高くなります。 リスト8-25のコー ...
https://man.plustar.jp/rust/book/ch08-03-hash-maps.html - [similar]
PREV 1 NEXT