検索

phrase: max: clip:
target: order:
Results of 1 - 5 of about 5 for rectangle (0.015 sec.)
メソッド - Rust By Example 日本語版 11821
Introduction 1. Hello World ❱ 1.1. コメント 1.2. フォーマットしてプリント ❱ 1.2.1. デバッグ 1.2. ... y: f64) -> Point { Point { x: x, y: y } } } struct Rectangle { p1: Point, p2: Point, } impl Rectangle { // This ... pe of the // caller object. In this case `Self` = `Rectangle` // こちらはメソッド。`&self`は`self: &Self`の糖衣 ... // `Self`は呼び出し元オブジェクトの型。この場合は`Rectangle`。 fn area(&self) -> f64 { // `self` gives access ... ら抜け出すと同時に、解放される。 } } fn main() { let rectangle = Rectangle { // Associated functions are called u ...
https://man.plustar.jp/rust/example/fn/methods.html - [similar]
Box, スタックとヒープ - Rust By Example 日本語版 10883
Introduction 1. Hello World ❱ 1.1. コメント 1.2. フォーマットしてプリント ❱ 1.2.1. デバッグ 1.2. ... lone, Copy)] struct Point { x: f64, y: f64, } // A Rectangle can be specified by where its top left and bottom ... // corners are in space #[allow(dead_code)] struct Rectangle { top_left: Point, bottom_right: Point, } fn origi ... に割り当てられる。 let point: Point = origin(); let rectangle: Rectangle = Rectangle { top_left: origin(), botto ... ht: Point { x: 3.0, y: -4.0 } }; // Heap allocated rectangle // ヒープ上に割り当てられたRectangle let boxed_rec ...
https://man.plustar.jp/rust/example/std/box.html - [similar]
構造体 - Rust By Example 日本語版 8420
Introduction 1. Hello World ❱ 1.1. コメント 1.2. フォーマットしてプリント ❱ 1.2.1. デバッグ 1.2. ... ールドになることができる #[allow(dead_code)] struct Rectangle { // A rectangle can be specified by where the top ... Point { x: left_edge, y: top_edge } = point; let _rectangle = Rectangle { // struct instantiation is an expres ... contains {:?} and {:?}", integer, decimal); } 演習 Rectangle の面積を計算する rect_area 関数を追加してください。 ... トを使ってみましょう。 Point と f32 を引数とした時に Rectangle を返す square 関数を追加してください。 Rectangle...
https://man.plustar.jp/rust/example/custom_types/structs.html - [similar]
Rust By Example 日本語版 7574
Introduction 1. Hello World ❱ 1.1. コメント 1.2. フォーマットしてプリント ❱ 1.2.1. デバッグ 1.2. ... ールドになることができる #[allow(dead_code)] struct Rectangle { // A rectangle can be specified by where the top ... Point { x: left_edge, y: top_edge } = point; let _rectangle = Rectangle { // struct instantiation is an expres ... contains {:?} and {:?}", integer, decimal); } 演習 Rectangle の面積を計算する rect_area 関数を追加してください。 ... トを使ってみましょう。 Point と f32 を引数とした時に Rectangle を返す square 関数を追加してください。 Rectangle...
https://man.plustar.jp/rust/example/print.html - [similar]
ジェネリック境界 - Rust By Example 日本語版 7225
Introduction 1. Hello World ❱ 1.1. コメント 1.2. フォーマットしてプリント ❱ 1.2.1. デバッグ 1.2. ... asArea { fn area(&self) -> f64; } impl HasArea for Rectangle { fn area(&self) -> f64 { self.length * self.heigh ... t } } #[derive(Debug)] struct Rectangle { length: f64, height: f64 } #[allow(dead_code)] s ... asArea>(t: &T) -> f64 { t.area() } fn main() { let rectangle = Rectangle { length: 3.0, height: 4.0 }; let _tri ... riangle { length: 3.0, height: 4.0 }; print_debug(&rectangle); println!("Area: {}", area(&rectangle)); //print_ ...
https://man.plustar.jp/rust/example/generics/bounds.html - [similar]
PREV 1 NEXT