Rust main function
-
fn
-
main
-
There are two types of crates: libraries and executables. The latter can also contain libraries.
-
For executable crates we must have a file called
src/main.rs
and it must have a function calledmain
. -
This is the most basic definition of a
main
function. It does nothing.
fn main() {}