Introduction
In this lab, you will learn about the various primitives provided by Rust, including scalar types such as signed and unsigned integers, floating-point numbers, Unicode scalar values, boolean values, and the unit type. You will also explore compound types like arrays and tuples, and learn how to annotate variables with their respective types or allow Rust to infer the types from context.
Note: If the lab does not specify a file name, you can use any file name you want. For example, you can use main.rs
, compile and run it with rustc main.rs && ./main
.
Skills Graph
%%%%{init: {'theme':'neutral'}}%%%%
flowchart RL
rust(("`Rust`")) -.-> rust/BasicConceptsGroup(["`Basic Concepts`"])
rust(("`Rust`")) -.-> rust/DataTypesGroup(["`Data Types`"])
rust(("`Rust`")) -.-> rust/FunctionsandClosuresGroup(["`Functions and Closures`"])
rust(("`Rust`")) -.-> rust/MemorySafetyandManagementGroup(["`Memory Safety and Management`"])
rust/BasicConceptsGroup -.-> rust/variable_declarations("`Variable Declarations`")
rust/BasicConceptsGroup -.-> rust/mutable_variables("`Mutable Variables`")
rust/DataTypesGroup -.-> rust/integer_types("`Integer Types`")
rust/DataTypesGroup -.-> rust/floating_types("`Floating-point Types`")
rust/DataTypesGroup -.-> rust/boolean_type("`Boolean Type`")
rust/FunctionsandClosuresGroup -.-> rust/function_syntax("`Function Syntax`")
rust/FunctionsandClosuresGroup -.-> rust/expressions_statements("`Expressions and Statements`")
rust/MemorySafetyandManagementGroup -.-> rust/lifetime_specifiers("`Lifetime Specifiers`")
subgraph Lab Skills
rust/variable_declarations -.-> lab-99191{{"`Rust Primitive Types Exploration`"}}
rust/mutable_variables -.-> lab-99191{{"`Rust Primitive Types Exploration`"}}
rust/integer_types -.-> lab-99191{{"`Rust Primitive Types Exploration`"}}
rust/floating_types -.-> lab-99191{{"`Rust Primitive Types Exploration`"}}
rust/boolean_type -.-> lab-99191{{"`Rust Primitive Types Exploration`"}}
rust/function_syntax -.-> lab-99191{{"`Rust Primitive Types Exploration`"}}
rust/expressions_statements -.-> lab-99191{{"`Rust Primitive Types Exploration`"}}
rust/lifetime_specifiers -.-> lab-99191{{"`Rust Primitive Types Exploration`"}}
end