検索

phrase: max: clip:
target: order:
Results of 1 - 10 of about 10 for Point (0.024 sec.)
ジェネリックなデータ型 - Rust 日本語版 12871
The Rust Programming Language 日本語版 まえがき はじめに 1. 事始め 1.1. インストール 1.2. Hello, ... クな型引数を使用することもできます。 リスト10-6は、 Point<T> 構造体を定義してあらゆる型の x と y 座標を保持す ... 方法を示しています。 ファイル名: src/main.rs struct Point<T> { x: T, y: T, } fn main() { let integer = Point ... { x: 5, y: 10 }; let float = Point { x: 1.0, y: 4.0 }; } リスト10-6: 型 T の x と y 値 ... を保持する Point<T> 構造体 構造体定義でジェネリクスを使用する記法は ...
https://man.plustar.jp/rust/book/ch10-01-syntax.html - [similar]
パターン記法 - Rust 日本語版 10976
The Rust Programming Language 日本語版 まえがき はじめに 1. 事始め 1.1. インストール 1.2. Hello, ... ンを使用して分解できる2つのフィールド x と y のある Point 構造体を示しています。 ファイル名: src/main.rs str ... uct Point { x: i32, y: i32, } fn main() { let p = Point { x: ... 0, y: 7 }; let Point { x: a, y: b } = p; assert_eq!(0, a); assert_eq!(7 ... 数名をフィールドに一致させることは一般的であり、 let Point{ x: x, y: y } = p; と書くことは多くの重複を含むので ...
https://man.plustar.jp/rust/book/ch18-03-pattern-syntax.html - [similar]
高度なトレイト - Rust 日本語版 10726
The Rust Programming Language 日本語版 まえがき はじめに 1. 事始め 1.1. インストール 1.2. Hello, ... ば、リスト19-22で + 演算子をオーバーロードして2つの Point インスタンスを足し合わせています。 Point 構造体に ... std::ops::Add; #[derive(Debug, PartialEq)] struct Point { x: i32, y: i32, } impl Add for Point { type Outp ... ut = Point; fn add(self, other: Point) -> Point { Point { x: ... y: self.y + other.y, } } } fn main() { assert_eq!(Point { x: 1, y: 0 } + Point { x: 2, y: 3 }, Point { x: ...
https://man.plustar.jp/rust/book/ch19-03-advanced-traits.html - [similar]
メソッド記法 - Rust 日本語版 8187
The Rust Programming Language 日本語版 まえがき はじめに 1. 事始め 1.1. インストール 1.2. Hello, ... d)] fn main() { #[derive(Debug,Copy,Clone)] struct Point { x: f64, y: f64, } impl Point { fn distance(&self ... , other: &Point) -> f64 { let x_squared = f64::powi(other.x - self ... 2); f64::sqrt(x_squared + y_squared) } } let p1 = Point { x: 0.0, y: 0.0 }; let p2 = Point { x: 5.0, y: 6. ...
https://man.plustar.jp/rust/book/ch05-03-method-syntax.html - [similar]
構造体を定義し、インスタンス化する - Rust 日本語版 8062
The Rust Programming Language 日本語版 まえがき はじめに 1. 事始め 1.1. インストール 1.2. Hello, ... に含まれる型を続けます。 例えば、こちらは、 Color と Point という2種類のタプル構造体の定義と使用法です: #![al ... )] fn main() { struct Color(i32, i32, i32); struct Point(i32, i32, i32); let black = Color(0, 0, 0); let or ... igin = Point(0, 0, 0); } black と origin の値は、違う型であるこ ... 型になります。 例えば、 Color 型を引数に取る関数は、 Point を引数に取ることはできません。たとえ、両者の型が、 ...
https://man.plustar.jp/rust/book/ch05-01-defining-structs.html - [similar]
ヒープのデータを指すBox<T>を使用する - Rust 日本語版 7776
The Rust Programming Language 日本語版 まえがき はじめに 1. 事始め 1.1. インストール 1.2. Hello, ... indirection (e.g., a `Box`, `Rc`, or `&`) at some point to make `List` representable (助言: 間接参照(例: ` ... indirection (e.g., a `Box`, `Rc`, or `&`) at some point to make `List` representable この提案において「間接 ...
https://man.plustar.jp/rust/book/ch15-01-box.html - [similar]
パターンが使用されることのある箇所全部 - Rust 日本語版 7776
The Rust Programming Language 日本語版 まえがき はじめに 1. 事始め 1.1. インストール 1.2. Hello, ... rent location: ({}, {})", x, y); } fn main() { let point = (3, 5); print_coordinates(&point); } リスト18-7: ...
https://man.plustar.jp/rust/book/ch18-01-all-the-places-for-patterns.html - [similar]
データ型 - Rust 日本語版 7669
The Rust Programming Language 日本語版 まえがき はじめに 1. 事始め 1.1. インストール 1.2. Hello, ... ) = (500, 6.4, 1); let five_hundred = x.0; let six_point_four = x.1; let one = x.2; } このプログラムは、新し ...
https://man.plustar.jp/rust/book/ch03-02-data-types.html - [similar]
キーとそれに紐づいた値をハッシュマップに格納する - Rust 日本語版 7669
The Rust Programming Language 日本語版 まえがき はじめに 1. 事始め 1.1. インストール 1.2. Hello, ... // field_name and field_value are invalid at this point, try using them and // see what compiler error you ...
https://man.plustar.jp/rust/book/ch08-03-hash-maps.html - [similar]
The Rust Programming Language 日本語版 7580
The Rust Programming Language 日本語版 まえがき はじめに 1. 事始め 1.1. インストール 1.2. Hello, ... 評価される値にはセットできません。 定数の名前が MAX_POINTS で、値が100,000にセットされた定数定義の例をご覧く ... ることです): #![allow(unused)] fn main() { const MAX_POINTS: u32 = 100_000; } 定数は、プログラムが走る期間、定 ... ) = (500, 6.4, 1); let five_hundred = x.0; let six_point_four = x.1; let one = x.2; } このプログラムは、新し ...
https://man.plustar.jp/rust/book/print.html - [similar]
PREV 1 NEXT