Code Monkey home page Code Monkey logo

learnrust's Introduction

rust基础只是学习与代码样例

Debug程序方法

  • Linux上使用rust-gdb
  • MacOs上使用rust-lldb [lldb]

rust官方资料

https://doc.rust-lang.org/stable/rust-by-example/hello.html

lldb

编译器选择

cargo vs rustc

You might note that cargo uses rustc. It is not a compiler by itself. Instead, it could be seen as a convenience wrapper, providing shortcuts to the commands used in almost every project. Then, one obvious (but extremely rare) case when you'd prefer rustc over cargo is if you need something which is easier to achieve by manually instructing the compiler then by describing your goal to cargo.

cargo 是上一层,最终调用rustc 推荐cargo

cargo 资源

https://doc.rust-lang.org/cargo/getting-started/index.html

  1. build release version with cargo but still keep debug info

https://stackoverflow.com/questions/38803760/how-to-get-a-release-build-with-debugging-information-when-using-cargo

  1. 文件锁在rust中的使用
  2. merkletree样例

attributes

  1. dead_code 编译器会报warning unused 如果加上这个,会过滤掉

cargo new 用于创建一个新的工程

cargo new [new path]
cargo init ## 用于当前的目录

更新当前的cargo rust版本

rustup update
https://www.rust-lang.org/tools/install

rust 学习

cargo add anyhow
cargo1.62 之后,可以用上面的方法来增加package依赖包

learnrust's People

Contributors

woshidama323 avatar

Stargazers

kai avatar Sean Brennan avatar

learnrust's Issues

LearnRust

rust笔记

### 1. 能否toml中依赖private repo
https://medium.com/@c_ameron/rust-how-to-build-a-docker-image-with-private-cargo-dependencies-ab91c25c4301

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.