Rust links¶

  • The Rust programming language [1].

  • Rust book experiment (brown.edu) - includes quizes! [6]

  • The cargo book

  • Cargo recognises semantic versioning

  • The rust standard library.

  • crates.io “Crates.io is where people in the Rust ecosystem post their open source Rust projects for others to use.”

The rust programming language book¶

The rust book calls rust programmers ‘rustaceans’.

Chapter 1 is an introduction to the basic tools, including cargo and the installation of the tools.

Chapter 2 starts a ‘guessing game’ program. This starts by using simple input/output with the std::io package.

There is a few examples of ‘cargo’ when one starts using the rand::Rng package, including the commands ‘cargo doc’, ‘cargo build’, ‘cargo update’.

The documentation example:

cargo doc --open

Chapter 4 talks about ownership, the very special rust concept:

  • Each value in rust has an owner

  • There can only be one owner at a time

  • When the owner goes out of scope, the value will be dropped.

Other things discussed are cloning, the Copy trait of a type, the drop method (that implements the Drop trait).

For function calls, passing a variable to a function will move or copy, just as assignment does.

The section on references explains the method as a way to avoid the (protocol) of getting ownership when entering a function and returning ownership on function return.

Normal references are not mutable. Adding mut changes the reference to mutable reference. Mutable references have one big restriction: if you have a mutable reference to a value, you can have no other references to that value.

Rust prevents the problem of data races by refusing to compile code with data races!

Rules of references:

  • you can have either one mutable reference (read/write) or any number of immutable references. (Swimmer, single write, multiple read).

  • references must be always valid - rust checks this with lifetimes [5] and ownership.

Rust (wikipedia), this includes a video in webm by Emily Dunham at linux.conf.au in 2017.

The Rust Cookbook [2]

The Rust Reference [3]

The Rust Standard Library [4] .. The Rust Standard Library: https://doc.rust-lang.org/nightly/std/index.html

Emily Dunham “Should you rewrite in Rust?” (youtube) (45 min) LinuxConfAu 2018, Sydney

http://talks.edunham.net/lca2018/should-you-rewrite-in-rust/

Footnotes

[1]

Accessed on 17 August 2019.

[2]

Accessed on 6 Oct 2019.

[3]

Accessed on 6 Oct 2019.

[4]

Accessed on 6 Oct 2019.

[5]

Still a topic to learn as I write this.

[6]

The content was different to the rust book when checking in Nov 2024.

puffer-fish

Navigation

Notes

  • Bash
  • CentOS
  • C Programming
  • C++ links
  • Git notes
  • Magit
  • Go
  • Linux material
  • Notes on debian system administration
  • Haskell
  • Kernel
  • Java serial lines
  • Javascript
  • kubernetes notes
  • kubernetes course, chapter #8
  • Kubernetes Pods
  • Nix
  • Nixpkgs
  • Macports
  • Macports folders
  • man pages
  • Gnu make
  • matplotlib
  • Questions about minikube
  • OSX notes
  • Podman
  • PowerShell
  • Python related links
  • Python and Qt
  • Rust links
  • Secure shell
  • Utilities

Emacs entries

  • Emacs
  • Notes on creating an emacs package

Fedora entries

  • Fedora
  • mock

Related Topics

  • Documentation overview
    • Previous: Python and Qt
    • Next: Secure shell
©2023, alst2821. | Powered by Sphinx 8.1.3 & Alabaster 1.0.0 | Page source