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.rsand it must have a function calledmain. -
This is the most basic definition of a
mainfunction. It does nothing.
fn main() {}