mirror of
https://github.com/tiyn/wiki.git
synced 2025-11-08 06:01:15 +01:00
Compare commits
4 Commits
efedc006ea
...
5a12bae277
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5a12bae277 | ||
|
|
859a48cc91 | ||
| 4e66c061ed | |||
| 05bebbc5c9 |
@@ -5,8 +5,9 @@
|
|||||||
## Setup
|
## Setup
|
||||||
|
|
||||||
The /name/ program can be installed [/via GitHub/]().
|
The /name/ program can be installed [/via GitHub/]().
|
||||||
Alternatively many linux package managers package /name/ in the `/package/`
|
Alternatively many [Linux](/wiki/linux.md) [package managers](/wiki/linux/package_manager.md)
|
||||||
package.
|
package /name/ in the `/package/`.
|
||||||
|
The software can be setup via [Docker](/wiki/docker.md) with the [/docker name/ image]().
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
|
|||||||
@@ -45,6 +45,8 @@ This section addresses various useful applications.
|
|||||||
[Markdown](/wiki/markup_language.md)
|
[Markdown](/wiki/markup_language.md)
|
||||||
- [SystemUI Tuner](https://play.google.com/store/apps/details?id=com.zacharee1.systemuituner) is an
|
- [SystemUI Tuner](https://play.google.com/store/apps/details?id=com.zacharee1.systemuituner) is an
|
||||||
application that allows various small tweaks for the Android user interface.
|
application that allows various small tweaks for the Android user interface.
|
||||||
|
- [SimpleMarkdown](https://f-droid.org/packages/com.wbrawner.simplemarkdown.free/) is another text
|
||||||
|
editor made for Markdown. It does work a bit better with a [NextCloud](/wiki/nextcloud.md).
|
||||||
|
|
||||||
## Improve Security and Privacy
|
## Improve Security and Privacy
|
||||||
|
|
||||||
|
|||||||
61
wiki/programming_language/rust.md
Normal file
61
wiki/programming_language/rust.md
Normal file
@@ -0,0 +1,61 @@
|
|||||||
|
# Rust
|
||||||
|
|
||||||
|
[Rust](https://www.rust-lang.org/) is a multiparadigm compiled systems programming language.
|
||||||
|
|
||||||
|
## Setup
|
||||||
|
|
||||||
|
Rust can be setup as explained on the [Rust website](https://rust-lang.org/tools/install/).
|
||||||
|
It is always recommended to install Rust via rustup.
|
||||||
|
Alternatively many [Linux](/wiki/linux.md) [package managers](/wiki/linux/package_manager.md)
|
||||||
|
package rustup in the `rustup` package.
|
||||||
|
|
||||||
|
## Usage
|
||||||
|
|
||||||
|
This section addresses the usage of Rust.
|
||||||
|
|
||||||
|
### Create a New Project
|
||||||
|
|
||||||
|
To create a new project use the command `cargo`.
|
||||||
|
The following is an example in which `<project-name>` is a placeholder for the projects name.
|
||||||
|
It will create a new directory called the same as the given project name.
|
||||||
|
|
||||||
|
```sh
|
||||||
|
cargo new <project-name>
|
||||||
|
```
|
||||||
|
|
||||||
|
If a project parent directory is already present the following command can be used which will turn
|
||||||
|
the parent directory in the root directory for a project.
|
||||||
|
|
||||||
|
```sh
|
||||||
|
cargo init
|
||||||
|
```
|
||||||
|
|
||||||
|
### Running Programs and Projects
|
||||||
|
|
||||||
|
When inside a project the main file can simply be run by using the following command.
|
||||||
|
This command can be called from anywhere within the project folder structure.
|
||||||
|
|
||||||
|
```sh
|
||||||
|
cargo run
|
||||||
|
```
|
||||||
|
|
||||||
|
If no project was initialized and just a Rust file is present run a command simliar to the
|
||||||
|
following, where `<rust-file>` is the name of the Rust file without the `.rs`-extension.
|
||||||
|
|
||||||
|
```sh
|
||||||
|
rustc <rust-file>.rs
|
||||||
|
./<rust-file>
|
||||||
|
```
|
||||||
|
|
||||||
|
### Managing Packages and Libraries
|
||||||
|
|
||||||
|
To use external libraries or packages `cargo` project has to be present since it is used to manage
|
||||||
|
them.
|
||||||
|
Using the following command a package can be downloaded and added to the dependencies for the
|
||||||
|
project.
|
||||||
|
`<package-name>` is a placeholder for the name of the package (for example `z3` for the theorem
|
||||||
|
prover).
|
||||||
|
|
||||||
|
```sh
|
||||||
|
cargo add <package-name>
|
||||||
|
```
|
||||||
Reference in New Issue
Block a user