GithubHelp home page GithubHelp logo

rust-todo-cli's Introduction

使用rust开发项目示例

rust语言的特点

  • 内存安全性高,自动管理内存

  • 并发性强,提供并发编程的原语

  • 高性能,与C++语言相当

  • 易用性,语法和结构简单

  • 跨平台性,支持不同操作系统

使用rust开发一个todo cli项目

  1. cargo init todo-project

  2. cargo run build 编译后执行二进制文件

  3. targe/Cargo.lock 文件对依赖的版本进行管理

  4. 文件的存储和读取

命令行使用

  1. cargo build

  2. 写入一个todo: cargo run -- -m add -p HelloWorld

  3. 列举某一天所在周的全部todo:cargo run -- -m lw

  4. -- 告诉 cargo 后面的参数是给我们的程序使用的,而不是给 cargo 自己使用,例如 -- 前的 run 就是给它用的。

使用rust读取文件

  1. cargo run -- They sample.txt

  2. **:关注点分离

学习

问题

  • 出现 Blocking waiting for file lock on package cache , 删除rm ~/.cargo/.package-cache

rust-todo-cli's People

Watchers

一点点前端 avatar  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.