ProductPromotion
Logo

Rust

made by https://0x3d.site

GitHub - cuppar/rtd: Learn Rust by 500 lines code
Learn Rust by 500 lines code. Contribute to cuppar/rtd development by creating an account on GitHub.
Visit Site

GitHub - cuppar/rtd: Learn Rust by 500 lines code

GitHub - cuppar/rtd: Learn Rust by 500 lines code

Learn Rust by 500 lines code

crate_version crate_downloads license

English | 中文

  • RTD (Rust To Do) is a todo app cli tool write by 500 lines Rust code. (exclude space lines/comments/long line break display/test code)
  • RTD is also a tutorial, designed to learn Rust by doing.

rtd_list_all

Table of contents


What can you learn from RTD?

Assuming you know nothing about Rust, through the Learn Rust by 500 lines code tutorial, step by step to build the project from scratch, you will learn:

  • Rust common syntax
  • Rust module system (package/binary crate/library crate/mod/pub/use)
  • Rust ownership model (Bernstein conditions)
  • Rust lifetime
  • Rust error/null handling model (Result<T, E>/Option<T>)
  • Rust generic
  • Rust pattern matching (if let , match ...)
  • Rust unit test
  • Rust file I/O (File Seek/Buffed File I/O)
  • Rust manipulating environment variables
  • Rust command line parameter parsing
  • Rust release package to crate.io
  • The general process of developing a program (requirements/design/implementation/testing/release/maintenance)
  • Layered abstraction (data storage layer/model mapping layer/data model layer/business logic layer/application interface layer/user interface layer)
  • Handwritten serialization/deserialization from scratch
  • Implement the recycle bin function (virtualization concept)
Architecture

rtd_arch

Storage

Use a local file $HOME/.rtd.csv store all data

data_storage rtd_list_all

After completing this tutorial or installing RTD directly, you will get:

  • Extremely lightweight and concise todo command line application
  • Cross-platform, Rust's excellent build system naturally supports cross-platform
  • Safe, supports recycle bin, completely local, no network, no database
  • All data storage uses only one local csv file, which can be switched between different machines by copying the csv file

Interesting fact: I use RTD to complete the RTD tutorial :)

If you like my tutorial, don't forget to give me a star~


Prepare

  • Rust is naturally cross-platform. This project is built and tested in the linux environment, and Windows/MacOS are also supported. You can choose to download the corresponding Cargo according to your own operating system.
  • Cargo Rust's package management and build tool, can be installed directly through the Rust official website rustup one line command. Then, all things will be done by Cargo, so cute, right?

Install

Via crate.io :

cargo install rtd-tutorial

Or via git repo :

git clone https://github.com/cuppar/rtd.git
cargo install --path rtd

Usage

View help document

rtd -h
rtd --help

rtd_help_summary rtd_help

Add a todo

rtd -a <item-name>
rtd --add <item-name>

rtd_add

List all uncompleted todos

rtd
rtd -l
rtd -l uncompleted
rtd --list
rtd --list uncompleted

rtd_list_uncompleted

Complete a todo

rtd -c <item-id>
rtd --complete <item-id>

rtd_complete_item

List all completed todos

rtd -l completed
rtd --list completed

rtd_list_completed

Uncomplete a todo

rtd -u <item-id>
rtd --uncomplete <item-id>

rtd_uncomplete_item

Throw a todo into the recycle bin

rtd -d <item-id>
rtd --delete <item-id>

rtd_delete_item

List all recycle bin todos

rtd -l deleted
rtd --list deleted

rtd_list_deleted

Restore a todo from the recycle bin

rtd -r <item-id>
rtd --restore <item-id>

rtd_restore_item

Physically destroy a todo

rtd --destroy <item-id>

rtd_destroy_item

Empty recycle bin

rtd --destroy-deleted

rtd_destroy_deleted

List all todos

rtd -l all
rtd --list all

rtd_list_all

Clear all todos

rtd --clear

rtd_clear

About author

Cuppar He(He Zhiying), software development engineer, likes programming, technical writing, learning new things, especially computer science, worked for SAP(World Top 100) and Alibaba Group(World Top 100 & Chinese internet giant). I am currently in Gap Year, if you are looking for a software development engineer and can provide a high-quality offer(Both remote and on-site), please contact me [email protected].

More Resources
to explore the angular.

mail [email protected] to add your project or resources here 🔥.

Related Articles
to learn about angular.

FAQ's
to learn more about Angular JS.

mail [email protected] to add more queries here 🔍.

More Sites
to check out once you're finished browsing here.

0x3d
https://www.0x3d.site/
0x3d is designed for aggregating information.
NodeJS
https://nodejs.0x3d.site/
NodeJS Online Directory
Cross Platform
https://cross-platform.0x3d.site/
Cross Platform Online Directory
Open Source
https://open-source.0x3d.site/
Open Source Online Directory
Analytics
https://analytics.0x3d.site/
Analytics Online Directory
JavaScript
https://javascript.0x3d.site/
JavaScript Online Directory
GoLang
https://golang.0x3d.site/
GoLang Online Directory
Python
https://python.0x3d.site/
Python Online Directory
Swift
https://swift.0x3d.site/
Swift Online Directory
Rust
https://rust.0x3d.site/
Rust Online Directory
Scala
https://scala.0x3d.site/
Scala Online Directory
Ruby
https://ruby.0x3d.site/
Ruby Online Directory
Clojure
https://clojure.0x3d.site/
Clojure Online Directory
Elixir
https://elixir.0x3d.site/
Elixir Online Directory
Elm
https://elm.0x3d.site/
Elm Online Directory
Lua
https://lua.0x3d.site/
Lua Online Directory
C Programming
https://c-programming.0x3d.site/
C Programming Online Directory
C++ Programming
https://cpp-programming.0x3d.site/
C++ Programming Online Directory
R Programming
https://r-programming.0x3d.site/
R Programming Online Directory
Perl
https://perl.0x3d.site/
Perl Online Directory
Java
https://java.0x3d.site/
Java Online Directory
Kotlin
https://kotlin.0x3d.site/
Kotlin Online Directory
PHP
https://php.0x3d.site/
PHP Online Directory
React JS
https://react.0x3d.site/
React JS Online Directory
Angular
https://angular.0x3d.site/
Angular JS Online Directory