検索

phrase: max: clip:
target: order:
Results of 1 - 10 of about 104 for This (0.057 sec.)
Rust By Example 日本語版 16201
Introduction 1. Hello World ❱ 1.1. コメント 1.2. フォーマットしてプリント ❱ 1.2.1. デバッグ 1.2. ... な"Hello World!"プログラムのソースを紹介します。 // This is a comment, and is ignored by the compiler // Yo ... u can test this code by clicking the "Run" button over there -> // ... ーボードを使いたければ「Ctrl + Enter」もOKです。 // This code is editable, feel free to hack it! // You can ... ボタンでいつでも元のコードに戻すことができます -> // This is the main function // main関数です fn main() { / ...
https://man.plustar.jp/rust/example/print.html - [similar]
Diverging functions - Rust By Example 日本語版 11372
Introduction 1. Hello World ❱ 1.1. コメント 1.2. フォーマットしてプリント ❱ 1.2.1. デバッグ 1.2. ... allow(unused)] fn main() { fn foo() -> ! { panic!("This call never returns."); } } As opposed to all the o ... ther types, this one cannot be instantiated, because the set of all ... possible values this type can have is empty. Note that, it is different ... which has exactly one possible value. For example, this function returns as usual, although there is no in ...
https://man.plustar.jp/rust/example/fn/diverging.html - [similar]
スコープとシャドーイング - Rust By Example 日本語版 9568
Introduction 1. Hello World ❱ 1.1. コメント 1.2. フォーマットしてプリント ❱ 1.2.1. デバッグ 1.2. ... クとは {} で囲まれた領域のことです。 fn main() { // This binding lives in the main function // この変数はma ... 関数内が生息域です。 let long_lived_binding = 1; // This is a block, and has a smaller scope than the main ... `より小さいスコープを持つブロックとなります。 { // This binding only exists in this block // この変数はこの ... intln!("inner short: {}", short_lived_binding); // This binding *shadows* the outer one // この変数はスコー ...
https://man.plustar.jp/rust/example/variable_bindings/scope.html - [similar]
メソッド - Rust By Example 日本語版 8538
Introduction 1. Hello World ❱ 1.1. コメント 1.2. フォーマットしてプリント ❱ 1.2.1. デバッグ 1.2. ... つ関連関数とメソッドを全て定義する。 impl Point { // This is an "associated function" because this function ... ngle { p1: Point, p2: Point, } impl Rectangle { // This is a method // `&self` is sugar for `self: &Self`, ... ere `Self` is the type of the // caller object. In this case `Self` = `Rectangle` // こちらはメソッド。`&s ... p2; 2.0 * ((x1 - x2).abs() + (y1 - y2).abs()) } // This method requires the caller object to be mutable // ...
https://man.plustar.jp/rust/example/fn/methods.html - [similar]
フォーマットしてプリント - Rust By Example 日本語版 8538
Introduction 1. Hello World ❱ 1.1. コメント 1.2. フォーマットしてプリント ❱ 1.2.1. デバッグ 1.2. ... ができます。 // There are various optional patterns this works with. Positional // arguments can be used. / ... まれる場所を指定することができます。 println!("{0}, this is {1}. {1}, this is {0}", "Alice", "Bob"); // As ... / You can right-align text with a specified width. This will output // " 1". 5 white spaces and a "1". // ... idth=6); // You can pad numbers with extra zeroes. This will output "000001". // 空白の代わりに0を使うこと ...
https://man.plustar.jp/rust/example/hello/print.html - [similar]
if let - Rust By Example 日本語版 7585
Introduction 1. Hello World ❱ 1.1. コメント 1.2. フォーマットしてプリント ❱ 1.2.1. デバッグ 1.2. ... = Some(7); match optional { Some(i) => { println!("This is a really long string and `{:?}`", i); // ^ Need ... ter!"); } else { // The condition evaluated false. This branch is the default: // 今回は`else if`の評価がf ... r"); } // Variable b does not match Foo::Bar // So this will print nothing if let Foo::Bar = b { println!( ... llows us to match non-parameterized enum variants. This is true even in cases where the enum doesn't imple ...
https://man.plustar.jp/rust/example/flow_control/if_let.html - [similar]
所有権とムーブ - Rust By Example 日本語版 7585
Introduction 1. Hello World ❱ 1.1. コメント 1.2. フォーマットしてプリント ❱ 1.2.1. デバッグ 1.2. ... これによりダングリングポインタの発生を防げます。 // This function takes ownership of the heap allocated mem ... !("a contains: {}", a); // TODO ^ Try uncommenting this line // TODO ^ 試しにここをアンコメントしてみましょ ... う。 // This function takes ownership of the heap allocated mem ... box(b); // Since the heap memory has been freed at this point, this action would // result in dereferencin ...
https://man.plustar.jp/rust/example/scope/move.html - [similar]
impl Trait - Rust By Example 日本語版 7585
Introduction 1. Hello World ❱ 1.1. コメント 1.2. フォーマットしてプリント ❱ 1.2.1. デバッグ 1.2. ... you can write its return type as -> impl MyTrait . This can help simplify your type signatures quite a lot ... ! use std::iter; use std::vec::IntoIter; // This function combines two `Vec<i32>` and returns an it ... { v.into_iter().chain(u.into_iter()).cycle() } // This is the exact same function, but its return type us ... losure. But now you can do it all statically, like this: // Returns a function that adds `y` to its input ...
https://man.plustar.jp/rust/example/trait/impl_trait.html - [similar]
Unit testing - Rust By Example 日本語版 7495
Introduction 1. Hello World ❱ 1.1. コメント 1.2. フォーマットしてプリント ❱ 1.2.1. デバッグ 1.2. ... ly. pub fn add(a: i32, b: i32) -> i32 { a + b } // This is a really bad adding function, its purpose is to ... fail in this // example. #[allow(dead_code)] fn bad_add(a: i32, ... -> i32 { a - b } #[cfg(test)] mod tests { // Note this useful idiom: importing names from outer (for mod ... q!(add(1, 2), 3); } #[test] fn test_bad_add() { // This assert would fire and test will fail. // Please no ...
https://man.plustar.jp/rust/example/testing/unit_testing.html - [similar]
Hello World - Rust By Example 日本語版 7405
Introduction 1. Hello World ❱ 1.1. コメント 1.2. フォーマットしてプリント ❱ 1.2.1. デバッグ 1.2. ... な"Hello World!"プログラムのソースを紹介します。 // This is a comment, and is ignored by the compiler // Yo ... u can test this code by clicking the "Run" button over there -> // ... ーボードを使いたければ「Ctrl + Enter」もOKです。 // This code is editable, feel free to hack it! // You can ... ボタンでいつでも元のコードに戻すことができます -> // This is the main function // main関数です fn main() { / ...
https://man.plustar.jp/rust/example/hello.html - [similar]
PREV 1 2 3 4 5 6 7 8 9 10 NEXT