検索

phrase: max: clip:
target: order:
Results of 1 - 10 of about 15 for Foo (0.025 sec.)
演算子のオーバーロード - Rust By Example 日本語版 13079
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; #[der ... ive(Debug)] struct BarFoo; // The `std::ops::Add` trait is used to specify t ... . // The following block implements the operation: Foo + Bar = FooBar // `std::ops::Add`トレイトは`+`の振 ... る舞いを規定するために使用される // ここでは`Foo`に対して`Add<Bar>`を実装する。これは加算時の右辺が ...
https://man.plustar.jp/rust/example/trait/ops.html - [similar]
if let - Rust By Example 日本語版 11999
Introduction 1. Hello World ❱ 1.1. コメント 1.2. フォーマットしてプリント ❱ 1.2.1. デバッグ 1.2. ... to match any enum value: // Our example enum enum Foo { Bar, Baz, Qux(u32) } fn main() { // Create examp ... le variables let a = Foo::Bar; let b = Foo::Baz; let c = Foo::Qux(100); // ... Variable a matches Foo::Bar if let Foo::Bar = a { println!("a is foobar") ... ; } // Variable b does not match Foo::Bar // So this will print nothing if let Foo::Bar ...
https://man.plustar.jp/rust/example/flow_control/if_let.html - [similar]
構造体 - Rust By Example 日本語版 9735
Introduction 1. Hello World ❱ 1.1. コメント 1.2. フォーマットしてプリント ❱ 1.2.1. デバッグ 1.2. ... にデストラクトすることができる。 fn main() { struct Foo { x: (u32, u32), y: u32, } // Try changing the val ... ues in the struct to see what happens let foo = Foo { x: (1, 2), y: 3 }; match foo { Foo { x: (1 ... ストラクトして変数をリネーム // 順番は重要ではない。 Foo { y: 2, x: i } => println!("y is 2, i = {:?}", i), ... e variables: // 一部の変数を無視することもできる。 Foo { y, .. } => println!("y = {}, we don't care about ...
https://man.plustar.jp/rust/example/flow_control/match/destructuring/destructure... - [similar]
Rust By Example 日本語版 9143
Introduction 1. Hello World ❱ 1.1. コメント 1.2. フォーマットしてプリント ❱ 1.2.1. デバッグ 1.2. ... って決まるということを見てきました 。 format!("{}", foo) -> "3735928559" format!("0x{:X}", foo) -> "0xDEAD ... BEEF" format!("0o{:o}", foo) -> "0o33653337357" ここでは( foo )という単一の変数 ... にデストラクトすることができる。 fn main() { struct Foo { x: (u32, u32), y: u32, } // Try changing the val ... ues in the struct to see what happens let foo = Foo { x: (1, 2), y: 3 }; match foo { Foo { x: (1 ...
https://man.plustar.jp/rust/example/print.html - [similar]
Tests - Rust By Example 日本語版 9073
Introduction 1. Hello World ❱ 1.1. コメント 1.2. フォーマットしてプリント ❱ 1.2.1. デバッグ 1.2. ... 内に、統合テストは tests/ ディレクトリ内に置きます。 foo ├── Cargo.toml ├── src │ └── main.rs │ └── lib.rs ... est test_bar ... ok test test_baz ... ok test test_foo_bar ... ok test test_foo ... ok test result: ok. 3 ... のテストを実行することもできます。 $ cargo test test_foo $ cargo test test_foo Compiling blah v0.1.0 (file: ... ps/blah-d3b32b97275ec472 running 2 tests test test_foo ... ok test test_foo_bar ... ok test result: ok. 2 ...
https://man.plustar.jp/rust/example/cargo/test.html - [similar]
明示的アノテーション - Rust By Example 日本語版 8934
Introduction 1. Hello World ❱ 1.1. コメント 1.2. フォーマットしてプリント ❱ 1.2.1. デバッグ 1.2. ... ものであるか、明示的なアノテーションを必要とします。 foo<'a> // `foo` has a lifetime parameter `'a` // `foo ... を必要とします。もう少し詳しく言うと、この書き方は「 foo のライフタイムは 'a のそれを超えることはない。」と ... フタイムが複数ある場合も、同じような構文になります。 foo<'a, 'b> // `foo` has lifetime parameters `'a` and ... `'b` // `foo`は`'a`と`'b`というライフタイムパラメータを持ちます ...
https://man.plustar.jp/rust/example/scope/lifetime/explicit.html - [similar]
Raw identifiers - Rust By Example 日本語版 8742
Introduction 1. Hello World ❱ 1.1. コメント 1.2. フォーマットしてプリント ❱ 1.2.1. デバッグ 1.2. ... in a newer edition. For example, consider a crate foo compiled with the 2015 edition of Rust that export ... uld have no way to name the function. extern crate foo; fn main() { foo::try(); } You'll get this error: ... ier, found keyword `try` --> src/main.rs:4:4 | 4 | foo::try(); | ^^^ expected identifier, found keyword Y ... can write this with a raw identifier: extern crate foo; fn main() { foo::r#try(); } 関連キーワード: ident ...
https://man.plustar.jp/rust/example/compatibility/raw_identifiers.html - [similar]
Dependencies - Rust By Example 日本語版 8394
Introduction 1. Hello World ❱ 1.1. コメント 1.2. フォーマットしてプリント ❱ 1.2.1. デバッグ 1.2. ... 下記のようにします。 # A binary # バイナリ cargo new foo # OR A library # またはライブラリ cargo new --lib ... ンドを実行すると、次のようなファイル階層ができます。 foo ├── Cargo.toml └── src └── main.rs main.rs がこの新 ... ことはありませんね。 Cargo.toml はこのプロジェクト( foo )の cargo の設定ファイルです。中を見てみるとこのよ ... うになっています。 [package] name = "foo" version = "0.1.0" authors = ["mark"] [dependencie ...
https://man.plustar.jp/rust/example/cargo/deps.html - [similar]
識別子 - Rust By Example 日本語版 7872
Introduction 1. Hello World ❱ 1.1. コメント 1.2. フォーマットしてプリント ❱ 1.2.1. デバッグ 1.2. ... y!($func_name)); } }; } // Create functions named `foo` and `bar` with the above macro. // 上のマクロを利 ... 用して`foo`、`bar`という名の関数を作成する。 create_function! ... (foo); create_function!(bar); macro_rules! print_result ... gify!($expression), $expression); }; } fn main() { foo(); bar(); print_result!(1u32 + 1); // Recall that ...
https://man.plustar.jp/rust/example/macros/designators.html - [similar]
フォーマット - Rust By Example 日本語版 7802
Introduction 1. Hello World ❱ 1.1. コメント 1.2. フォーマットしてプリント ❱ 1.2.1. デバッグ 1.2. ... って決まるということを見てきました 。 format!("{}", foo) -> "3735928559" format!("0x{:X}", foo) -> "0xDEAD ... BEEF" format!("0o{:o}", foo) -> "0o33653337357" ここでは( foo )という単一の変数 ...
https://man.plustar.jp/rust/example/hello/print/fmt.html - [similar]
PREV 1 2 NEXT