学習パス

構造体、列挙型、トレイト

構造体と列挙型でデータを表し、パターンマッチを使い、Option と Result を扱い、トレイトとジェネリクスで振る舞いを共有します。

レッスン 10 件 · チャレンジ 14 件

  1. レッスン チャレンジ 1 件 Structs Group related values into your own type with named fields.
  2. レッスン チャレンジ 2 件 Methods and impl Blocks Attach functions to a struct with impl, including constructors.
  3. レッスン チャレンジ 1 件 Enums Define a type that is one of several variants, each with its own data.
  4. レッスン チャレンジ 2 件 Pattern Matching with match Compare a value against patterns with match, guards and if let.
  5. レッスン チャレンジ 1 件 Temperature Converter Convert between Celsius and Fahrenheit with an enum.
  6. レッスン チャレンジ 2 件 Option: Values That May Be Missing Represent a missing value with Option instead of null.
  7. レッスン チャレンジ 2 件 Error Handling with Result Return errors as values with Result and pass them on with the ? operator.
  8. レッスン チャレンジ 1 件 Bank Account with Result Model deposits and withdrawals that can fail with your own error type.
  9. レッスン チャレンジ 1 件 Traits Describe shared behavior with a trait and implement it for different types.
  10. レッスン チャレンジ 1 件 Generics Write one function or struct that works with many types.