検索

phrase: max: clip:
target: order:
Results of 1 - 8 of about 8 for Length (0.020 sec.)
テストケース: 単位を扱う - Rust By Example 日本語版 13700
Introduction 1. Hello World ❱ 1.1. コメント 1.2. フォーマットしてプリント ❱ 1.2.1. デバッグ 1.2. ... h {} #[derive(Debug, Clone, Copy)] enum Mm {} /// `Length` is a type with phantom type parameter `Unit`, /// ... and is not generic over the length type (that is `f64`). /// `Length`は`Unit`という幽 ... を持っている。 #[derive(Debug, Clone, Copy)] struct Length<Unit>(f64, PhantomData<Unit>); /// The `Add` trait ... 加算演算子(`+`)の挙動を定義する。 impl<Unit> Add for Length<Unit> { type Output = Length<Unit>; // add() retur ...
https://man.plustar.jp/rust/example/generics/phantom/testcase_units.html - [similar]
ジェネリック境界 - Rust By Example 日本語版 9145
Introduction 1. Hello World ❱ 1.1. コメント 1.2. フォーマットしてプリント ❱ 1.2.1. デバッグ 1.2. ... sArea for Rectangle { fn area(&self) -> f64 { self.length * self.height } } #[derive(Debug)] struct Rectangl ... e { length: f64, height: f64 } #[allow(dead_code)] struct Tri ... angle { length: f64, height: f64 } // The generic `T` must implem ... t.area() } fn main() { let rectangle = Rectangle { length: 3.0, height: 4.0 }; let _triangle = Triangle { le ...
https://man.plustar.jp/rust/example/generics/bounds.html - [similar]
安全でない操作 - Rust By Example 日本語版 8639
Introduction 1. Hello World ❱ 1.1. コメント 1.2. フォーマットしてプリント ❱ 1.2.1. デバッグ 1.2. ... a slice given a pointer to the first element and a length. use std::slice; fn main() { let some_vector = vec ... 2, 3, 4]; let pointer = some_vector.as_ptr(); let length = some_vector.len(); unsafe { let my_slice: &[u32] ... = slice::from_raw_parts(pointer, length); assert_eq!(some_vector.as_slice(), my_slice); } ...
https://man.plustar.jp/rust/example/unsafe.html - [similar]
テストケース: 連結リスト - Rust By Example 日本語版 8585
Introduction 1. Hello World ❱ 1.1. コメント 1.2. フォーマットしてプリント ❱ 1.2.1. デバッグ 1.2. ... である。 Cons(elem, Box::new(self)) } // Return the length of the list // list の長さを返すメソッド fn len(&s ... + tail.len(), // Base Case: An empty list has zero length // 空リストならば長さは0 Nil => 0 } } // Return re ... st // 追加後の状態を表示 println!("linked list has length: {}", list.len()); println!("{}", list.stringify() ...
https://man.plustar.jp/rust/example/custom_types/enum/testcase_linked_list.html - [similar]
Rust By Example 日本語版 8079
Introduction 1. Hello World ❱ 1.1. コメント 1.2. フォーマットしてプリント ❱ 1.2.1. デバッグ 1.2. ... されます。長さはコンパイル時には決定されていて、 [T; length] という形で指定できます。 スライスは配列に似ていま ... である。 Cons(elem, Box::new(self)) } // Return the length of the list // list の長さを返すメソッド fn len(&s ... + tail.len(), // Base Case: An empty list has zero length // 空リストならば長さは0 Nil => 0 } } // Return re ... st // 追加後の状態を表示 println!("linked list has length: {}", list.len()); println!("{}", list.stringify() ...
https://man.plustar.jp/rust/example/print.html - [similar]
Rc - Rust By Example 日本語版 8079
Introduction 1. Hello World ❱ 1.1. コメント 1.2. フォーマットしてプリント ❱ 1.2.1. デバッグ 1.2. ... / We can use methods of a value directly println!("Length of the value inside rc_a: {}", rc_a.len()); printl ...
https://man.plustar.jp/rust/example/std/rc.html - [similar]
配列とスライス - Rust By Example 日本語版 8007
Introduction 1. Hello World ❱ 1.1. コメント 1.2. フォーマットしてプリント ❱ 1.2.1. デバッグ 1.2. ... されます。長さはコンパイル時には決定されていて、 [T; length] という形で指定できます。 スライスは配列に似ていま ...
https://man.plustar.jp/rust/example/primitives/array.html - [similar]
ベクタ型 - Rust By Example 日本語版 8007
Introduction 1. Hello World ❱ 1.1. コメント 1.2. フォーマットしてプリント ❱ 1.2.1. デバッグ 1.2. ... ッドは現在のベクタのサイズを返す。 println!("Vector length: {}", xs.len()); // Indexing is done using the squ ...
https://man.plustar.jp/rust/example/std/vec.html - [similar]
PREV 1 NEXT