프로젝트
Via
Or via
소개
500줄의 코드로 Rust를 배워 보세요.
학습 및 교육측정된 스타 증가
- in 24h
- -1
- in 7 days
- 0
- in 15 days
- +2
- in 1 month
- 기록 수집 중
서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.
README.md
OriginalLearn Rust by 500 lines code
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.

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
Storage
Use a local file $HOME/.rtd.csv store all data

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
linuxenvironment, andWindows/MacOSare also supported. You can choose to download the correspondingCargoaccording to your own operating system. CargoRust's package management and build tool, can be installed directly through the Rust official websiterustupone line command. Then, all things will be done byCargo, 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

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

List all uncompleted todos
rtd
rtd -l
rtd -l uncompleted
rtd --list
rtd --list uncompleted

Complete a todo
rtd -c <item-id>
rtd --complete <item-id>

List all completed todos
rtd -l completed
rtd --list completed

Uncomplete a todo
rtd -u <item-id>
rtd --uncomplete <item-id>

Throw a todo into the recycle bin
rtd -d <item-id>
rtd --delete <item-id>

List all recycle bin todos
rtd -l deleted
rtd --list deleted

Restore a todo from the recycle bin
rtd -r <item-id>
rtd --restore <item-id>

Physically destroy a todo
rtd --destroy <item-id>

Empty recycle bin
rtd --destroy-deleted

List all todos
rtd -l all
rtd --list all

Clear all todos
rtd --clear

관련 프로젝트 살펴보기
불러오는 중…