検索

phrase: max: clip:
target: order:
Results of 1 - 8 of about 8 for age (0.019 sec.)
New Type Idiom - Rust By Example 日本語版 11133
Introduction 1. Hello World ❱ 1.1. コメント 1.2. フォーマットしてプリント ❱ 1.2.1. デバッグ 1.2. ... (Don't Repeat Yourself) 17.3. Domain Specific Languages (ドメイン特化言語、DSLs) 17.4. 可変個引数 18. エラ ... of value is supplied to a program. For example, an age verification function that checks age in years, mu ... ) -> Years { Years(self.0 / 365) } } fn old_enough(age: &Years) -> bool { age.0 >= 18 } fn main() { let a ... ge = Years(5); let age_days = age.to_days(); println!("Old enough {}", ol ...
https://man.plustar.jp/rust/example/generics/new_types.html - [similar]
?によるOptionのアンパック - Rust By Example 日本語版 10718
Introduction 1. Hello World ❱ 1.1. コメント 1.2. フォーマットしてプリント ❱ 1.2.1. デバッグ 1.2. ... (Don't Repeat Yourself) 17.3. Domain Specific Languages (ドメイン特化言語、DSLs) 17.4. 可変個引数 18. エラ ... 了させ、 None を返します。 fn next_birthday(current_age: Option<u8>) -> Option<String> { // If `current_ag ... e` is `None`, this returns `None`. // If `current_age` is `Some`, the inner `u8` gets assigned to `next_ ... age` // `current_age`が`None`の場合、`None`を返す。 // `current_age`が` ...
https://man.plustar.jp/rust/example/error/option_unwrap/question_mark.html - [similar]
Partial moves - Rust By Example 日本語版 10627
Introduction 1. Hello World ❱ 1.1. コメント 1.2. フォーマットしてプリント ❱ 1.2.1. デバッグ 1.2. ... (Don't Repeat Yourself) 17.3. Domain Specific Languages (ドメイン特化言語、DSLs) 17.4. 可変個引数 18. エラ ... ) { #[derive(Debug)] struct Person { name: String, age: u8, } let person = Person { name: String::from("A ... lice"), age: 20, }; // `name` is moved out of person, but `age ... ` is referenced let Person { name, ref age } = person; println!("The person's age is {}", age ...
https://man.plustar.jp/rust/example/scope/move/partial_move.html - [similar]
バインディング - Rust By Example 日本語版 10320
Introduction 1. Hello World ❱ 1.1. コメント 1.2. フォーマットしてプリント ❱ 1.2.1. デバッグ 1.2. ... (Don't Repeat Yourself) 17.3. Domain Specific Languages (ドメイン特化言語、DSLs) 17.4. 可変個引数 18. エラ ... をバインディングすることができます。 // A function `age` which returns a `u32`. // `age`関数は`u32`の値を返 ... す。 fn age() -> u32 { 15 } fn main() { println!("Tell me what ... type of person you are"); match age() { 0 => println!("I haven't celebrated my first b ...
https://man.plustar.jp/rust/example/flow_control/match/binding.html - [similar]
Disambiguating overlapping traits - Rust By Example 日本語版 8910
Introduction 1. Hello World ❱ 1.1. コメント 1.2. フォーマットしてプリント ❱ 1.2.1. デバッグ 1.2. ... (Don't Repeat Yourself) 17.3. Domain Specific Languages (ドメイン特化言語、DSLs) 17.4. 可変個引数 18. エラ ... ut of this widget fn get(&self) -> String; } trait AgeWidget { // Get the selected age out of this widget ... u8; } // A form with both a UsernameWidget and an AgeWidget struct Form { username: String, age: u8, } i ... (&self) -> String { self.username.clone() } } impl AgeWidget for Form { fn get(&self) -> u8 { self.age } ...
https://man.plustar.jp/rust/example/trait/disambiguating.html - [similar]
Rust By Example 日本語版 7211
Introduction 1. Hello World ❱ 1.1. コメント 1.2. フォーマットしてプリント ❱ 1.2.1. デバッグ 1.2. ... (Don't Repeat Yourself) 17.3. Domain Specific Languages (ドメイン特化言語、DSLs) 17.4. 可変個引数 18. エラ ... [derive(Debug)] struct Person<'a> { name: &'a str, age: u8 } fn main() { let name = "Peter"; let age = 27 ... ; let peter = Person { name, age }; // Pretty print println!("{:#?}", peter); } 手動 ... erson { // The 'a defines a lifetime name: String, age: u8, } // A unit struct // ユニット struct Unit; / ...
https://man.plustar.jp/rust/example/print.html - [similar]
デバッグ - Rust By Example 日本語版 6705
Introduction 1. Hello World ❱ 1.1. コメント 1.2. フォーマットしてプリント ❱ 1.2.1. デバッグ 1.2. ... (Don't Repeat Yourself) 17.3. Domain Specific Languages (ドメイン特化言語、DSLs) 17.4. 可変個引数 18. エラ ... [derive(Debug)] struct Person<'a> { name: &'a str, age: u8 } fn main() { let name = "Peter"; let age = 27 ... ; let peter = Person { name, age }; // Pretty print println!("{:#?}", peter); } 手動 ...
https://man.plustar.jp/rust/example/hello/print/print_debug.html - [similar]
構造体 - Rust By Example 日本語版 6597
Introduction 1. Hello World ❱ 1.1. コメント 1.2. フォーマットしてプリント ❱ 1.2.1. デバッグ 1.2. ... (Don't Repeat Yourself) 17.3. Domain Specific Languages (ドメイン特化言語、DSLs) 17.4. 可変個引数 18. エラ ... erson { // The 'a defines a lifetime name: String, age: u8, } // A unit struct // ユニット struct Unit; / ... 簡略記法で生成 let name = String::from("Peter"); let age = 27; let peter = Person { name, age }; // Print d ...
https://man.plustar.jp/rust/example/custom_types/structs.html - [similar]
PREV 1 NEXT