A comprehensive Rust learning repository containing projects, programs, questions, and examples covering various Rust concepts from basics to advanced topics.
Learning project focused on Rust's fundamental data types (integers, floats, booleans, strings, etc.)
Cargo.toml- Project configurationsrc/main.rs- Basic data type examples
Covers arrays, tuples, and other compound types in Rust
Cargo.toml- Project configurationsrc/main.rs- Compound type examples and usage
Practice projects and session-based exercises
Cargo.toml- Project configurationsrc/main.rs- Session examples
Learning declarative macros in Rust (macro_rules!)
Cargo.toml- Project configurationsrc/lib.rs- Macro library definitionssrc/main.rs- Macro usage examples
Advanced procedural macros for custom syntax and code generation
Cargo.toml- Project configurationsrc/lib.rs- Procedural macro definitionssrc/main.rs- Macro usage examplestarget/- Build artifacts
FFI (Foreign Function Interface) - calling C++ functions from Rust
build.rs- Build scriptCargo.toml- Project configuration with C++ dependenciessrc/main.rs- Rust codesrc_lib/lib.cpp- C++ library coderead.txt- Documentation
FFI implementation with direct C++ integration
build.rs- Build scriptCargo.toml- Project configurationsrc/FFI.cpp- C++ FFI codesrc/main.rs- Rust FFI bindings
Additional FFI and interoperability examples
build.rs- Build scriptCargo.toml- Project configurationsrc/file.cpp- C++ sourcesrc/main.rs- Rust integration code
A structured set of 21 progressive Rust questions covering essential concepts and topics:
| # | Topic | Concepts |
|---|---|---|
| 1 | Ownership and Borrowing | References, Borrowing, String slices |
| 2 | Mutable Variables | Mutability, Variable declaration |
| 3 | If-Else Conditions | Control flow, Comparison operators |
| 4 | Pattern Matching | Match expressions, Enum patterns |
| 5 | Struct and Method | Structs, Methods, Implementation blocks |
| # | Topic | Concepts |
|---|---|---|
| 6 | Traits and Implementation | Traits, Trait implementation, Method resolution |
| 7 | Generics | Generic functions, Generic structs, Type parameters |
| 8 | Lifetimes | Lifetime annotations, Reference lifetimes |
| 9 | Error Handling | Result, Error types, Error propagation |
| 10 | Module and Visibility | Modules, pub keyword, Module organization |
| 11 | Closures | Closure syntax, Capture mechanisms, Fn traits |
| 12 | Iterator | Iterator trait, Functional programming |
| 13 | Collection Types | Vec, HashMap, HashSet, BTreeMap |
| 14 | String Operations | String manipulation, Slicing, Methods |
| 15 | Type Conversions | From, Into, as keyword, TryFrom |
| # | Topic | Concepts |
|---|---|---|
| 16 | Smart Pointers | Box, Rc, Arc, RefCell, Mutex |
| 17 | Concurrency | Threads, Message passing, Synchronization |
| 18 | Macros | Macro rules, Procedural macros |
| 19 | Associated Types | Traits with associated types |
| 20 | Trait Objects | Dynamic dispatch, dyn keyword |
| 21 | Advanced Traits | Trait bounds, Higher-ranked trait bounds |
main.rs_Declarative_Macro- Declarative macro examplesmain.rs_Doubly_LinkList- Doubly linked list implementationmain.rs_dynamic_dispatch- Dynamic dispatch and trait objectsmain.rs_file_reading- File I/O operationsmain.rs_macro_fn_inpu- Macro functions and input handlingmain.rs_RefCellPtr- RefCell pointer usagemain.rs_Refrence_Pointer- Reference and pointer patternsmain.rs_SlinkList_BoxPtr- Single linked list with Box pointersmain.rs_Thread_local_Var- Thread-local variablesmain.rs_thread_Mtx_Conv- Threading with mutex and synchronizationmain.rs_trait_impl- Trait implementation patternsmain.rs_box_ptr_Drop_trait- Box pointers and Drop trait
main.rs_enum- Enumeration patterns and usagemain.rs_String- Advanced string handlingmain.rs_struct_Hash- Structs with hashingmain.rs_Trait- Trait advanced concepts
Solutions to coding challenge problems (Exercism style)
rust/armstrong-numbers/- Armstrong number solutionsrust/gigasecond/- Time arithmetic solutionsrust/hello-world/- Hello world implementationsrust/reverse-string/- String reversal solutions
- Understand ownership and borrowing
- Master variable mutability
- Learn control flow
- Work with basic structs
- Implement traits and generics
- Handle errors properly
- Use closures and iterators
- Organize code with modules
- Master smart pointers
- Implement concurrency
- Create and use macros
- Implement advanced trait patterns
cd Program_Question
cat src/main.rs_Que_1 # View question
cargo run --bin main # Run current main.rscd <project-folder>
cargo runcargo doc --open- Ownership & Borrowing
- Pattern Matching
- Structs & Traits
- Generics & Lifetimes
- Collections & Iterators
- Error Handling
- Closures & Functional Programming
- Modules & Visibility
- Smart Pointers
- Concurrency & Threading
- Macros (Declarative & Procedural)
- FFI & C++ Integration
- Advanced Trait Patterns
- File I/O Operations
- Type Conversions
- Each question file in
Program_Question/src/contains detailed problem statements and concepts - Use
main.rs_*files as reference implementations - Comments in code explain key concepts
- Build and run to see working examples
Last Updated: April 2026