検索

phrase: max: clip:
target: order:
Results of 1 - 3 of about 3 for Rectangle (0.009 sec.)
メソッド記法 - Rust 日本語版 10808
The Rust Programming Language 日本語版 まえがき はじめに 1. 事始め 1.1. インストール 1.2. Hello, ... る構造体インスタンスを表します。 メソッドを定義する Rectangle インスタンスを引数に取る area 関数を変え、代わりに ... Rectangle 構造体上に area メソッドを作りましょう。 リスト5-1 ... ね。 ファイル名: src/main.rs #[derive(Debug)] struct Rectangle { width: u32, height: u32, } impl Rectangle { fn a ... lf.width * self.height } } fn main() { let rect1 = Rectangle { width: 30, height: 50 }; println!( "The area of ...
https://man.plustar.jp/rust/book/ch05-03-method-syntax.html - [similar]
構造体を使ったプログラム例 - Rust 日本語版 10398
The Rust Programming Language 日本語版 まえがき はじめに 1. 事始め 1.1. インストール 1.2. Hello, ... うようにプログラムをリファクタリングします。 Cargoで rectangles という新規バイナリプロジェクトを作成しましょう。こ ... 長方形の面積は、{}平方ピクセルです "The area of the rectangle is {} square pixels.", area(width1, height1) ); } ... でこのプログラムを走らせてください: The area of the rectangle is 1500 square pixels. (長方形の面積は、1500平方ピ ... { let rect1 = (30, 50); println!( "The area of the rectangle is {} square pixels.", area(rect1) ); } fn area(di ...
https://man.plustar.jp/rust/book/ch05-02-example-structs.html - [similar]
テストの記述法 - Rust 日本語版 6678
The Rust Programming Language 日本語版 まえがき はじめに 1. 事始め 1.1. インストール 1.2. Hello, ... を確認する助けになるわけです。 第5章のリスト5-15で、 Rectangle 構造体と can_hold メソッドを使用しました。リスト11 ... う。 ファイル名: src/lib.rs #[derive(Debug)] struct Rectangle { width: u32, height: u32, } impl Rectangle { fn c ... an_hold(&self, other: &Rectangle) -> bool { self.width > other.width && self.height ... ther.height } } fn main() {} リスト11-5: 第5章から Rectangle 構造体とその can_hold メソッドを使用する can_hold ...
https://man.plustar.jp/rust/book/ch11-01-writing-tests.html - [similar]
PREV 1 NEXT