de410314a3
This pulls in several fixes from these repositories: * riot-sys: * Add `random` module to `riot-headers` (https://github.com/RIOT-OS/rust-riot-sys/pull/26) * README: fix 2 typos (https://github.com/RIOT-OS/rust-riot-sys/pull/31) * bindgen: Use 0.64 (https://github.com/RIOT-OS/rust-riot-sys/pull/30) * wolfSSL support added (https://github.com/RIOT-OS/rust-riot-sys/pull/28) * extern-types: Generate replacement types dynamically (https://github.com/RIOT-OS/rust-riot-sys/pull/27) * Extern types: Add netq_t, make them large (https://github.com/RIOT-OS/rust-riot-sys/pull/25) * doc: Suppress warnings about things C2Rust does not uphold (https://github.com/RIOT-OS/rust-riot-sys/pull/23) * export macro_DAC_LINE (https://github.com/RIOT-OS/rust-riot-sys/pull/22) * Add BINDGEN_OUTPUT_FILE export (https://github.com/RIOT-OS/rust-riot-sys/pull/21) * riot-wrappers: * DAC: Add wrapper around RIOTs DAC-interface (https://github.com/RIOT-OS/rust-riot-wrappers/pull/36) * saul: Compatibly rename G* variants (https://github.com/RIOT-OS/rust-riot-wrappers/pull/50) * tests: Add test for auto-init when auto-init debug is active (https://github.com/RIOT-OS/rust-riot-wrappers/pull/48) * gcoap: Provide link encoder (https://github.com/RIOT-OS/rust-riot-wrappers/pull/47) * Drop SUIT support in riot-wrappers (https://github.com/RIOT-OS/rust-riot-wrappers/pull/44) * Add an auto init module (https://github.com/RIOT-OS/rust-riot-wrappers/pull/45) * gcoap: Allow registration without scope for 'static listeners (https://github.com/RIOT-OS/rust-riot-wrappers/pull/43) Through direct dependency changes (the bindgen update), the number of transitive dependencies could be reduced. |
||
---|---|---|
.. | ||
src | ||
Cargo.lock | ||
Cargo.toml | ||
Makefile | ||
README.md |
Hello World!
This is a basic example how to use Rust to write your RIOT application.
It prints out the famous text Hello World!
.
This example should foremost give you an overview how an application built completely in Rust is structured:
-
The Makefile resembles the regular application Makefile, see ../hello-world/ for more introduction to that.
-
The Cargo.toml file describes the Rust code, and declares its dependencies.
Prominently, it contains a
[lib]
/crate-type = ["staticlib"]
section, which is necessary for how RIOT later links together the C and Rust portions. -
The file src/lib.rs (and any modules referenced by it) contain Rust code to be run.
It uses the
riot_main!
macro provided by the riot-wrappers crate to declare the entry point of the program.
The code itself looks like the usual Rust hello-world example.