Basics
Variables, types, structs, enums, and fundamental Rust syntax.
9 examples
BasicsOwnershipCompound TypesFlow ControlFunctionsGenericsTraitsError HandlingCollectionsConcurrencyAsyncSmart PointersIteratorsPatternsModulesMacrosUnsafeLifetimesTestingFile I/OSerializationCLI
beginner8 examples
Constants and Static
Difference between const and static variables in Rust.
Custom Struct
Define and instantiate a custom struct with named fields.
Enums Basic
Define enums with data variants and match on them.
Formatted Print
Use format!, print!, and println! macros for formatted output.
Hello World
Print text to the standard output with println! macro.
Numeric Conversions
Convert between numeric types safely.
Primitive Types
Scalar and compound types in Rust: integers, floats, booleans, tuples, arrays.
Type Aliases
Use type aliases to create shorter names for complex types.