検索

phrase: max: clip:
target: order:
Results of 1 - 10 of about 10 for borrow (0.026 sec.)
エイリアス - Rust By Example 日本語版 13336
Introduction 1. Hello World ❱ 1.1. コメント 1.2. フォーマットしてプリント ❱ 1.2.1. デバッグ 1.2. ... { let mut point = Point { x: 0, y: 0, z: 0 }; let borrowed_point = &point; let another_borrow = &point; // ... す。 println!("Point has coordinates: ({}, {}, {})", borrowed_point.x, another_borrow.y, point.z); // Error! C ... an't borrow `point` as mutable because it's currently // borro ... ュータブルに借用することができない。 // let mutable_borrow = &mut point; // TODO ^ Try uncommenting this line ...
https://man.plustar.jp/rust/example/scope/borrow/alias.html - [similar]
ミュータビリティ - Rust By Example 日本語版 10547
Introduction 1. Hello World ❱ 1.1. コメント 1.2. フォーマットしてプリント ❱ 1.2.1. デバッグ 1.2. ... ook // この関数はBook型へのリファレンスを取る。 fn borrow_book(book: &Book) { println!("I immutably borrowed ... &mut Book) { book.year = 2014; println!("I mutably borrowed {} - {} edition", book.title, book.year); } fn m ... 名付ける let mut mutabook = immutabook; // Immutably borrow an immutable object // イミュータブルなオブジェクト ... をイミュータブルに借用する borrow_book(&immutabook); // Immutably borrow a mutable o ...
https://man.plustar.jp/rust/example/scope/borrow/mut.html - [similar]
借用 - Rust By Example 日本語版 9689
Introduction 1. Hello World ❱ 1.1. コメント 1.2. フォーマットしてプリント ❱ 1.2.1. デバッグ 1.2. ... という場合がほとんどです。そのために、Rustでは 借用( borrowing ) という仕組みを用います。値そのもの( T )を受け ... that contains {}", boxed_i32); } // This function borrows an i32 // この関数はi32を借用する fn borrow_i32(b ... orrowed_i32: &i32) { println!("This int is: {}", borrowed_i32); } fn main() { // Create a boxed i32, and a ... i32 = Box::new(5_i32); let stacked_i32 = 6_i32; // Borrow the contents of the box. Ownership is not taken, / ...
https://man.plustar.jp/rust/example/scope/borrow.html - [similar]
要素の捕捉 - Rust By Example 日本語版 9206
Introduction 1. Hello World ❱ 1.1. コメント 1.2. フォーマットしてプリント ❱ 1.2.1. デバッグ 1.2. ... ); // A closure to print `color` which immediately borrows (`&`) `color` and // stores the borrow and closur ... e in the `print` variable. It will remain // borrowed until `print` is used the last time. // // `prin ... color`: {}", color); // Call the closure using the borrow. // 借用を行ったクロージャをコールする。 print(); ... // `color` can be borrowed immutably again, because the closure only holds ...
https://man.plustar.jp/rust/example/fn/closures/capture.html - [similar]
明示的アノテーション - Rust By Example 日本語版 8527
Introduction 1. Hello World ❱ 1.1. コメント 1.2. フォーマットしてプリント ❱ 1.2.1. デバッグ 1.2. ... いがライフタイムパラメータ`'a`を持つ関数。 fn failed_borrow<'a>() { let _x = 12; // ERROR: `_x` does not live ... はできない。 } fn main() { // Create variables to be borrowed below. // 下で借用するための変数を作成 let (four ... , nine) = (4, 9); // Borrows (`&`) of both variables are passed into the funct ... る。 print_refs(&four, &nine); // Any input which is borrowed must outlive the borrower. // In other words, th ...
https://man.plustar.jp/rust/example/scope/lifetime/explicit.html - [similar]
Rust By Example 日本語版 7848
Introduction 1. Hello World ❱ 1.1. コメント 1.2. フォーマットしてプリント ❱ 1.2.1. デバッグ 1.2. ... グネチャを持ちます。 use std::mem; // This function borrows a slice // この関数はスライスを借用する fn analyz ... :size_of_val(&xs)); // Arrays can be automatically borrowed as slices // 配列は自動的にスライスとして借用され ... る。 println!("borrow the whole array as a slice"); analyze_slice(&xs); ... ex はスライスの末尾の1つ先の位置を表す。 println!("borrow a section of the array as a slice"); analyze_slice ...
https://man.plustar.jp/rust/example/print.html - [similar]
配列とスライス - Rust By Example 日本語版 7758
Introduction 1. Hello World ❱ 1.1. コメント 1.2. フォーマットしてプリント ❱ 1.2.1. デバッグ 1.2. ... グネチャを持ちます。 use std::mem; // This function borrows a slice // この関数はスライスを借用する fn analyz ... :size_of_val(&xs)); // Arrays can be automatically borrowed as slices // 配列は自動的にスライスとして借用され ... る。 println!("borrow the whole array as a slice"); analyze_slice(&xs); ... ex はスライスの末尾の1つ先の位置を表す。 println!("borrow a section of the array as a slice"); analyze_slice ...
https://man.plustar.jp/rust/example/primitives/array.html - [similar]
refパターン - Rust By Example 日本語版 7758
Introduction 1. Hello World ❱ 1.1. コメント 1.2. フォーマットしてプリント ❱ 1.2.1. デバッグ 1.2. ... i32, y: i32 } fn main() { let c = 'Q'; // A `ref` borrow on the left side of an assignment is equivalent to ... // an `&` borrow on the right side. // 左辺に`ref`をつけることによる ...
https://man.plustar.jp/rust/example/scope/borrow/ref.html - [similar]
Partial moves - Rust By Example 日本語版 7365
Introduction 1. Hello World ❱ 1.1. コメント 1.2. フォーマットしてプリント ❱ 1.2.1. デバッグ 1.2. ... intln!("The person's name is {}", name); // Error! borrow of partially moved value: `person` partial move oc ...
https://man.plustar.jp/rust/example/scope/move/partial_move.html - [similar]
ライフタイム - Rust By Example 日本語版 7276
Introduction 1. Hello World ❱ 1.1. コメント 1.2. フォーマットしてプリント ❱ 1.2.1. デバッグ 1.2. ... etime because its scope entirely encloses // both `borrow1` and `borrow2`. The duration of `borrow1` compare ... d // to `borrow2` is irrelevant since they are disjoint. // 以下で ... 。 // `i`は最長のライフタイムを持ち、そのスコープは`borrow1`および`borrow2` // のスコープを完全に包含します。 ... `borrow1`と`borrow2`の存続期間は一切重なりません。 fn main ...
https://man.plustar.jp/rust/example/scope/lifetime.html - [similar]
PREV 1 NEXT