検索

phrase: max: clip:
target: order:
Results of 1 - 10 of about 58 for struct (0.022 sec.)
構造体 - Rust By Example 日本語版 15032
Introduction 1. Hello World ❱ 1.1. コメント 1.2. フォーマットしてプリント ❱ 1.2.1. デバッグ 1.2. ... Rust Coal Navy Ayu Rust By Example 日本語版 構造体 struct というキーワードを用いて作成できる構造体には3種類あ ... ジェネリック型を扱う際に有効です。 #[derive(Debug)] struct Person { // The 'a defines a lifetime name: String ... , age: u8, } // A unit struct // ユニット struct Unit; // A tuple struct // タプ ...struct Pair(i32, f32); // A struct with two fields // 2つ ...
https://man.plustar.jp/rust/example/custom_types/structs.html - [similar]
Rust By Example 日本語版 12763
Introduction 1. Hello World ❱ 1.1. コメント 1.2. フォーマットしてプリント ❱ 1.2.1. デバッグ 1.2. ... 他の基本データ型について学びましょう。 カスタム型 - struct と enum について。 変数の束縛 - ミュータブルな束縛 ... ME ^ Add the missing argument: "James" // Create a structure named `Structure` which contains an `i32`. // ` ... i32`保持する `Structure` という名の構造体を定義します. #[allow(dead_cod ... e)] struct Structure(i32); // However, custom types such as t ...
https://man.plustar.jp/rust/example/print.html - [similar]
継承(Derive) - Rust By Example 日本語版 9470
Introduction 1. Hello World ❱ 1.1. コメント 1.2. フォーマットしてプリント ❱ 1.2.1. デバッグ 1.2. ... ーマットするためのトレイト // `Centimeters`, a tuple struct that can be compared // `Centimeters`は比較可能なタ ... プルになる #[derive(PartialEq, PartialOrd)] struct Centimeters(f64); // `Inches`, a tuple struct that ... ches`はプリント可能なタプルになる #[derive(Debug)] struct Inches(i32); impl Inches { fn to_centimeters(&self ... rs(inches as f64 * 2.54) } } // `Seconds`, a tuple struct with no additional attributes // `Seconds`には特に ...
https://man.plustar.jp/rust/example/trait/derive.html - [similar]
デバッグ - Rust By Example 日本語版 9265
Introduction 1. Hello World ❱ 1.1. コメント 1.2. フォーマットしてプリント ❱ 1.2.1. デバッグ 1.2. ... はなりません。 #![allow(unused)] fn main() { // This structure cannot be printed either with `fmt::Display` or ... のいずれによっても // プリントすることができません。 struct UnPrintable(i32); // The `derive` attribute automa ... eates the implementation // required to make this `struct` printable with `fmt::Debug`. // `derive`アトリビュ ... するための実装を自動で提供します。 #[derive(Debug)] struct DebugPrintable(i32); } std ライブラリの型の場合は、 ...
https://man.plustar.jp/rust/example/hello/print/print_debug.html - [similar]
メソッド - Rust By Example 日本語版 8548
Introduction 1. Hello World ❱ 1.1. コメント 1.2. フォーマットしてプリント ❱ 1.2.1. デバッグ 1.2. ... 特有の記法が必要です。 #![allow(unused)] fn main() { struct S; // Concrete type `S` // 具象型`S` struct Generi ... `が先に来る必要がある。 impl<T> GenericVal<T> {} } struct Val { val: f64, } struct GenVal<T> { gen_val: T, } ... alue(), y.value()); } 参照 参照を返す関数 , impl , struct 関連キーワード: メソッド , impl , 関数 , GenericVa ...
https://man.plustar.jp/rust/example/generics/impl.html - [similar]
幽霊型パラメータ - Rust By Example 日本語版 8343
Introduction 1. Hello World ❱ 1.1. コメント 1.2. フォーマットしてプリント ❱ 1.2.1. デバッグ 1.2. ... 。 use std::marker::PhantomData; // A phantom tuple struct which is generic over `A` with hidden parameter `B ... is type. // 比較演算子(`==`)での比較を可能にする。 struct PhantomTuple<A, B>(A,PhantomData<B>); // A phantom ... type struct which is generic over `A` with hidden parameter `B ... for this type. // 比較演算子での比較を可能にする。 struct PhantomStruct<A, B> { first: A, phantom: PhantomDa ...
https://man.plustar.jp/rust/example/generics/phantom.html - [similar]
構造体の場合 - Rust By Example 日本語版 8343
Introduction 1. Hello World ❱ 1.1. コメント 1.2. フォーマットしてプリント ❱ 1.2.1. デバッグ 1.2. ... 化)を達成するための機能です。 mod my { // A public struct with a public field of generic type `T` // パブリッ ... ド`T`(ジェネリック型)を持つパブリックな構造体 pub struct OpenBox<T> { pub contents: T, } // A public struct ... 型)を持つパブリックな構造体 #[allow(dead_code)] pub struct ClosedBox<T> { contents: T, } impl<T> ClosedBox<T> ... { // A public constructor method // パブリックなコンストラクタメソッドを持 ...
https://man.plustar.jp/rust/example/mod/struct_visibility.html - [similar]
ディスプレイ - Rust By Example 日本語版 8035
Introduction 1. Hello World ❱ 1.1. コメント 1.2. フォーマットしてプリント ❱ 1.2.1. デバッグ 1.2. ... ュールをインポートします。 use std::fmt; // Define a structure for which `fmt::Display` will be implemented. T ... his is // a tuple struct named `Structure` that contains an `i32`. // `fmt: ... lay`を実装するための構造体を定義します。 // これは`Structure`という名前に紐付けられた、`i32`を含むタプルです ...struct Structure(i32); // To use the `{}` marker, the tra ...
https://man.plustar.jp/rust/example/hello/print/print_display.html - [similar]
クローン - Rust By Example 日本語版 7933
Introduction 1. Hello World ❱ 1.1. コメント 1.2. フォーマットしてプリント ❱ 1.2.1. デバッグ 1.2. ... イトで定義されている .clone() を用います。 // A unit struct without resources // いかなる資源も持たない構造体 ... #[derive(Debug, Clone, Copy)] struct Unit; // A tuple struct with resources that implem ... の変数を資源として持つタプル #[derive(Clone, Debug)] struct Pair(Box<i32>, Box<i32>); fn main() { // Instantia ...
https://man.plustar.jp/rust/example/trait/clone.html - [similar]
演算子のオーバーロード - Rust By Example 日本語版 7933
Introduction 1. Hello World ❱ 1.1. コメント 1.2. フォーマットしてプリント ❱ 1.2.1. デバッグ 1.2. ... レイトの一覧は core::ops にあります。 use std::ops; struct Foo; struct Bar; #[derive(Debug)] struct FooBar; # ... [derive(Debug)] struct BarFoo; // The `std::ops::Add` trait is used to sp ...
https://man.plustar.jp/rust/example/trait/ops.html - [similar]
PREV 1 2 3 4 5 6 NEXT