Articles Hierarchy

Articles Home » RPI » RUST on RPI


even with so many soft and hardware projects open i still think i have to keep my mind open
for new things:

a programming language i want to know what it is and how i can play with it on a Raspberry Pi.

see a video about it here,
go to RUST website install
and find documentation: book

* booting up my old RPI3B+
* update
* install RUST
curl --proto '=https' --tlsv1.2 -sSf | sh
and reboot.

rustc --version
cargo --version

i see here 1.51.0

start rust project with:

mkdir rust
cd rust

cargo new test_rust

cd test_rust
cargo build or directly
cargo run ( means build & run )

and now can use manual start:

for edit:
nano src/

fn main() { println!("Hello, KLL!"); }

even in the mini desktop version of Raspberry Pi OS
GEANY is preinstalled and that can be used ( besides 'nano' )
as editor / -IDE-

in the video also make a LED blink using
rust_gpiozero = "0.2.0"

instead of play and learn RUST i think ( for new year 2022 )
what could i do with RUST?

and i found ROCKET a web framework for RUST

i do on my RPI3 on a test setup USB stick for the new BULLSEYE Linux OS
where i tested RUST already

mkdir test_rocket
cd test_rocket
git clone
cd Rocket

cd examples/hello_world
cargo run

that's a long building...( with 2 warnings )
( using ROCKET v0.5.0-rc.1 )

no while this test of a Rust Rocket example worked well ( more here )
as a next test i try to copy one of the examples out ( to MY APP ) and had a hard time to get it build/compiled/run
must copy what sub-directories and change what path info in Cargo.toml

i started from the TO-DO example because it has already html template files and sqlite3 database

for this i add installed ( sudo apt install )

while i work on that i needed a backup batch

now to learn more i follow
where he uses
instead of ROCKET.

mkdir test_actix
cd test_actix
cargo new bee-nice
cd bee-nice
nano Cargo.toml

name = "bee-nice"
version = "0.1.0"
edition = "2018"

actix-web = "3"

nano src/

use std::io;

use actix_web::{get, App, HttpResponse, HttpServer, Responder};

async fn hello() -> impl Responder {
HttpResponse::Ok().body("Hello, world!")

async fn main() -> io::Result<()> {
HttpServer::new(|| App::new().service(hello))

cargo build
cargo run

check browser localhost:8080
( note: only works local, NOT from remote like ( ) )

and also i follow the next example what uses CSS and a template HTML file
what got little text data from variables.

cargo build --release
get a 10 times smaller executable in

now the upper level for web- server / site would be a CMS Content Management System
and see that you could install a runable or try to build it from github source ( 12MB zip ).
for available themes see

i needed some time to understand / find info / that this is far from my understanding of a CMS with a database
and online 'news/blog' add, edit, delete admin ( login ) pages.

basically in a directory you write / or 'ftp upload'
a '' file markup style with title / desc / blogtext
and the server code runable finds it, creates a link on the index page and shows it ( if clicked ).

so while for my feeling the Content Management features are poor its qualities might be somewhere else ?themes?HTML?CSS?

next want check on
here my LOG:
-1- install RUST

curl --proto '=https' --tlsv1.2 -sSf | sh

-2- install NODE
( on RPI4 with BULLSEYE can not install node v14..17

curl -sL | sudo -E bash -

sudo npm install --global yarn

-3- follow #
and install:

cargo install tsync

cargo install create-rust-app

create-rust-app my-todo-app
/// asks
[create-rust-app] Running `git config`
[create-rust-app] You do not have a git user name set.
Choose a name to use when committing:: test
[create-rust-app] Running `git config "test"`
[create-rust-app] You do not have a git user email set.
Choose an email to use when committing::
[create-rust-app] Running `git config ""`

/// shows
Congratulations, your project is ready!
[create-rust-app] • Install cargo-watch (for development)
[create-rust-app] $ cargo install cargo-watch
[create-rust-app] • Install diesel (to manage the database)
[create-rust-app] $ cargo install diesel_cli --no-default-features --features "postgres"
[create-rust-app] • Begin development!
[create-rust-app] 1. Change to your project directory
[create-rust-app] $ cd "./my-todo-app"
[create-rust-app] 2. Open `.env` and set the DATABASE_URL
[create-rust-app] 3. Setup your database:
[create-rust-app] $ diesel database reset
[create-rust-app] 4. Develop! Run the following for continuous compilation:
[create-rust-app] $ cargo fullstack
[create-rust-app] • Enjoy!