Giter VIP home page Giter VIP logo

learn_rust_book's Introduction

Introduction

The purpose of this repository is to improve understanding of Rust programming language concepts through coding, using the official Rust book as a foundation.

Please note that the repository does not contain any production-ready implementations and is not intended to be a complete project.

Therefore, the codebase structure does not follow any design patterns and is kept as simple as possible, with scope-based delimiters being used in most places.

Internal Structure

The repository consists of several workspaces:

  • rust_book_runner - serves as the workspace entry point and is responsible for enumerating and running a specific chapter.
  • rust_book - contains implementations for each chapter.
  • The other workspaces are chapter-specific implementations where the workspace is a more convenient way to represent a code sample compared to a module or a single rs-file.

Each chapter has a corresponding rs-file (rust_book/src/chapter_001.rs) that contains a public function named pub fn run(subchapter: u32). This function serves as the entry point for the chapter and encapsulates sub-chapter calls.

Each subchapter corresponds to a function in the format fn chapter_m_n(), where m is the chapter index, and n is the subchapter index.

CLI

$ rust_book_runner --help

Run specific chapter and subchapter.

To run a specific chapter and subchapter, you should specify the chapter ID in the format X.Y, where X is the chapter index and Y is the subchapter index.

For example, to run Chapter 3, Subchapter 2, you would specify 3.2:

$ rust_book_runner -c 3.2

If the chapter ID consists of a single number, that means all subchapters under the specified chapter number will be run.

If no chapter ID is specified, the most recent chapter will be run.

Usage: rust_book_runner [OPTIONS]

Options:
  -c, --chapter-id <CHAPTER_ID>
          Chapter ID. For example, `10.1`
          
          [default: "ChapterID (0, 0)"]

  -l, --list
          List available chapters

  -h, --help
          Print help (see a summary with '-h')

learn_rust_book's People

Contributors

alexander-borodulya avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.