検索
Results of 1 - 10 of about 193 for string (0.014 sec.)
- 文字列 - Rust By Example 日本語版 17329
- Introduction 1. Hello World ❱ 1.1. コメント 1.2. フォーマットしてプリント ❱ 1.2.1. デバッグ 1.2.
...6.1. FromおよびInto 6.2. TryFromおよびTryInto 6.3. Stringとの型変換 7. 式 8. 条件分岐 ❱ 8.1. if/else 8.2. loo...本語版 文字列 Rustには文字列を扱う型が2つあります。 String と &str です。 String は有効なUTF-8の配列であること...は有効なUTF-8の配列のスライス( &[u8] )で、いつでも String に変換することができます。 &[T] がいつでも Vec<T>...e annotations are superfluous) // A reference to a string allocated in read only memory // (以下の例では型を... - https://man.plustar.jp/rust/example/std/str.html - [similar]
- impl Trait - Rust By Example 日本語版 8387
- Introduction 1. Hello World ❱ 1.1. コメント 1.2. フォーマットしてプリント ❱ 1.2.1. デバッグ 1.2.
...6.1. FromおよびInto 6.2. TryFromおよびTryInto 6.3. Stringとの型変換 7. 式 8. 条件分岐 ❱ 8.1. if/else 8.2. loo...d::io::BufRead>(src: R) -> std::io::Result<Vec<Vec<String>>> { src.lines() .map(|line| { // For each line in...// Split the line separated by commas .map(|entry| String::from(entry.trim())) // Remove leading and trailin...g whitespace .collect() // Collect all strings in a row into a Vec<String> }) }) .collect() // C... - https://man.plustar.jp/rust/example/trait/impl_trait.html - [similar]
- 引数のパース - Rust By Example 日本語版 8300
- Introduction 1. Hello World ❱ 1.1. コメント 1.2. フォーマットしてプリント ❱ 1.2.1. デバッグ 1.2.
...6.1. FromおよびInto 6.2. TryFromおよびTryInto 6.3. Stringとの型変換 7. 式 8. 条件分岐 ❱ 8.1. if/else 8.2. loo...r - 1); } fn help() { println!("usage: match_args <string> Check whether given string is the answer. match_a...ven integer by one."); } fn main() { let args: Vec<String> = env::args().collect(); match args.len() { // no...second argument not an integer usage: match_args <string> Check whether given string is the answer. match_a... - https://man.plustar.jp/rust/example/std_misc/arg/matching.html - [similar]
- 列挙型 - Rust By Example 日本語版 8029
- Introduction 1. Hello World ❱ 1.1. コメント 1.2. フォーマットしてプリント ❱ 1.2.1. デバッグ 1.2.
...6.1. FromおよびInto 6.2. TryFromおよびTryInto 6.3. Stringとの型変換 7. 式 8. 条件分岐 ❱ 8.1. if/else 8.2. loo...geLoad != PageUnload` and `KeyPress(char) != Paste(String)`. // Each is different and independent. // `enum`...= PageUnload` であり、 // `KeyPress(char) != Paste(String)` である。 // 要素型は互いに異なり、互いに非依存で...structs, // タプル風でもよい KeyPress(char), Paste(String), // or c-like structures. // C言語スタイルの構造体... - https://man.plustar.jp/rust/example/custom_types/enum.html - [similar]
- スタティックライフタイム - Rust By Example 日本語版 8029
- Introduction 1. Hello World ❱ 1.1. コメント 1.2. フォーマットしてプリント ❱ 1.2.1. デバッグ 1.2.
...6.1. FromおよびInto 6.2. TryFromおよびTryInto 6.3. Stringとの型変換 7. 式 8. 条件分岐 ❱ 8.1. if/else 8.2. loo...i32) -> &'a i32 { &NUM } fn main() { { // Make a `string` literal and print it: // 文字列リテラルを用いて変...数を作成し、プリントする let static_string = "I'm in read-only memory"; println!("static_stri...ng: {}", static_string); // When `static_string` goes out of scope, the r... - https://man.plustar.jp/rust/example/scope/lifetime/static_lifetime.html - [similar]
- Stringとの型変換 - Rust By Example 日本語版 7844
- Introduction 1. Hello World ❱ 1.1. コメント 1.2. フォーマットしてプリント ❱ 1.2.1. デバッグ 1.2.
...6.1. FromおよびInto 6.2. TryFromおよびTryInto 6.3. Stringとの型変換 7. 式 8. 条件分岐 ❱ 8.1. if/else 8.2. loo...fault) Rust Coal Navy Ayu Rust By Example 日本語版 Stringとの型変換 Stringへの型変換 任意の型を String に変換...するのは簡単で、その型に ToString トレイトを実装するだけです。これを直接実装するより...を実装するのがよいでしょう。そうすることで自動的に ToString が提供されるだけでなく、 print! の章で説明したよう... - https://man.plustar.jp/rust/example/conversion/string.html - [similar]
- Rust By Example 日本語版 7844
- Introduction 1. Hello World ❱ 1.1. コメント 1.2. フォーマットしてプリント ❱ 1.2.1. デバッグ 1.2.
...6.1. FromおよびInto 6.2. TryFromおよびTryInto 6.3. Stringとの型変換 7. 式 8. 条件分岐 ❱ 8.1. if/else 8.2. loo...ます。 format! : フォーマットされたテキストを文字列(String)型に書き込みます。 print! : format! と同様ですが、...ally replaced with any // arguments. These will be stringified. // 一般的に `{} `はどんな引数であろうと自動的...です。 fmt::Display トレイトを実装すると、自動的に ToString トレイトが実装されます。これにより String 型への型... - https://man.plustar.jp/rust/example/print.html - [similar]
- 関数 - Rust By Example 日本語版 7659
- Introduction 1. Hello World ❱ 1.1. コメント 1.2. フォーマットしてプリント ❱ 1.2.1. デバッグ 1.2.
...6.1. FromおよびInto 6.2. TryFromおよびTryInto 6.3. Stringとの型変換 7. 式 8. 条件分岐 ❱ 8.1. if/else 8.2. loo...-> &'a i32 { x } //fn invalid_output<'a>() -> &'a String { &String::from("foo") } // The above is invalid:...'a` must live longer than the function. // Here, `&String::from("foo")` would create a `String`, followed by...はならないため上の関数は正しくない。 // ここでは、`&String::from("foo")`は`String`のデータとそれへの参照を作り... - https://man.plustar.jp/rust/example/scope/lifetime/fn.html - [similar]
- Supertraits - Rust By Example 日本語版 7572
- Introduction 1. Hello World ❱ 1.1. コメント 1.2. フォーマットしてプリント ❱ 1.2.1. デバッグ 1.2.
...6.1. FromおよびInto 6.2. TryFromおよびTryInto 6.3. Stringとの型変換 7. 式 8. 条件分岐 ❱ 8.1. if/else 8.2. loo...ait. For example: trait Person { fn name(&self) -> String; } // Person is a supertrait of Student. // Implem...n. trait Student: Person { fn university(&self) -> String; } trait Programmer { fn fav_language(&self) -> St...: Programmer + Student { fn git_username(&self) -> String; } fn comp_sci_student_greeting(student: &dyn Comp... - https://man.plustar.jp/rust/example/trait/supertraits.html - [similar]
- ファイルシステムとのやり取り - Rust By Example 日本語版 7485
- Introduction 1. Hello World ❱ 1.1. コメント 1.2. フォーマットしてプリント ❱ 1.2.1. デバッグ 1.2.
...6.1. FromおよびInto 6.2. TryFromおよびTryInto 6.3. Stringとの型変換 7. 式 8. 条件分岐 ❱ 8.1. if/else 8.2. loo...`のシンプルな実装 fn cat(path: &Path) -> io::Result<String> { let mut f = File::open(path)?; let mut s = Stri...ng::new(); match f.read_to_string(&mut s) { Ok(_) => Ok(s), Err(e) => Err(e), } } //...with ? notation: fn cat(path: &Path) -> io::Result<String> { let mut f = File::open(path)?; let mut s = Stri... - https://man.plustar.jp/rust/example/std_misc/fs.html - [similar]