This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
prog:rust:intro [2024/06/24 10:43] – Frank Fegert | prog:rust:intro [2024/06/24 12:48] (current) – Frank Fegert | ||
---|---|---|---|
Line 14: | Line 14: | ||
[[https:// | [[https:// | ||
+ | https:// | ||
+ | [[https:// | ||
+ | [[https:// | ||
/* [[]]\\ */ | /* [[]]\\ */ | ||
Line 38: | Line 41: | ||
====== Getting Help ====== | ====== Getting Help ====== | ||
- | |||
- | FIXME | ||
Manual pages: | Manual pages: | ||
<cli> | <cli> | ||
- | user@host: | + | user@host: |
+ | user@host: | ||
+ | user@host: | ||
+ | user@host: | ||
+ | </ | ||
+ | |||
+ | Builtin //Cargo// help: | ||
+ | |||
+ | < | ||
+ | user@host: | ||
+ | user@host: | ||
+ | user@host: | ||
</ | </ | ||
====== Install ====== | ====== Install ====== | ||
- | To install //Rust// on Debian: | + | To install //Rust// and its build toolchain and package manager //Cargo// on Debian: |
<cli> | <cli> | ||
Line 55: | Line 67: | ||
</ | </ | ||
- | To install //Rust// from a more recent version on Debian: | + | To install //Rust// and its build toolchain and package manager //Cargo// from a more recent version on Debian: |
<cli> | <cli> | ||
Line 66: | Line 78: | ||
====== Usage ====== | ====== Usage ====== | ||
+ | |||
+ | ===== Creating a new project ===== | ||
+ | |||
+ | <cli> | ||
+ | user@host: | ||
+ | </ | ||
+ | |||
+ | ===== Compile and run a project ===== | ||
+ | |||
+ | Compile and run a project *with* debugging information: | ||
+ | |||
+ | <cli> | ||
+ | user@host: | ||
+ | user@host: | ||
+ | user@host: | ||
+ | </ | ||
+ | |||
+ | Compile and run a project *optimized* and *without* debugging information: | ||
+ | |||
+ | <cli> | ||
+ | user@host: | ||
+ | </ | ||
+ | |||
+ | ===== Clean a project ===== | ||
+ | |||
+ | Clean a project from the artefacts of a previous compile and run: | ||
+ | |||
+ | <cli> | ||
+ | user@host: | ||
+ | </ | ||
+ | |||
+ | ===== Add a dependency to a project ===== | ||
+ | |||
+ | Add a external library dependency to a project. E.g. '' | ||
+ | |||
+ | <cli> | ||
+ | user@host: | ||
+ | </ | ||
+ | |||
+ | Manually add a external library dependency to a project. E.g. '' | ||
+ | |||
+ | <cli> | ||
+ | user@host: | ||
+ | </ | ||
+ | |||
+ | File contents: | ||
+ | |||
+ | <file config hello_world/ | ||
+ | [...] | ||
+ | |||
+ | [dependencies] | ||
+ | ferris-says = " | ||
+ | </ | ||
+ | |||
+ | Update the projects main code: | ||
+ | |||
+ | <cli> | ||
+ | user@host: | ||
+ | </ | ||
+ | |||
+ | File contents: | ||
+ | |||
+ | <file config hello_world/ | ||
+ | use ferris_says:: | ||
+ | use std:: | ||
+ | |||
+ | fn main() { | ||
+ | let stdout = stdout(); | ||
+ | let message = b" | ||
+ | let width = 24; | ||
+ | |||
+ | let mut writer = BufWriter:: | ||
+ | say(message, | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | Compile and run the updated project: | ||
+ | |||
+ | <cli> | ||
+ | user@host: | ||
+ | </ | ||
+ | |||
+ | ===== Set a dependency to a specific version in a project ===== | ||
+ | |||
+ | Set a first and second level dependency to a specific version in a project: | ||
+ | |||
+ | <cli> | ||
+ | user@host: | ||
+ | user@host: | ||
+ | </ | ||
FIXME | FIXME |