1
0
mirror of https://github.com/kamranahmedse/developer-roadmap.git synced 2025-09-01 13:22:38 +02:00

Redraw rust roadmap

This commit is contained in:
Kamran Ahmed
2025-06-17 03:32:31 +01:00
parent 3feaabcf0d
commit 8e020a90b7
209 changed files with 7738 additions and 9494 deletions

View File

@@ -0,0 +1,155 @@
---
description:
globs:
alwaysApply: false
---
# Content Migration Rule
## Rule Name: content-migration
## Description
This rule provides a complete process for migrating roadmap content from old structure to new structure using migration mapping files.
## When to Use
Use this rule when you need to:
- Migrate content from content-old directories to content directories
- Use a migration-mapping.json file to map topic paths to content IDs
- Populate empty content files with existing content from legacy structure
## Process
### 1. Prerequisites Check
- Verify the roadmap directory has a `migration-mapping.json` file
- Confirm `content-old/` directory exists with source content
- Confirm `content/` directory exists with target files
### 2. Migration Script Creation
Create a Node.js script with the following functionality:
```javascript
const fs = require('fs');
const path = require('path');
// Load the migration mapping
const migrationMapping = JSON.parse(fs.readFileSync('migration-mapping.json', 'utf8'));
// Function to find old content file based on topic path
function findOldContentFile(topicPath) {
const parts = topicPath.split(':');
if (parts.length === 1) {
// Top level file like "introduction"
return path.join('content-old', parts[0], 'index.md');
} else if (parts.length === 2) {
// Like "introduction:what-is-rust"
const [folder, filename] = parts;
return path.join('content-old', folder, `${filename}.md`);
} else if (parts.length === 3) {
// Like "language-basics:syntax:variables"
const [folder, subfolder, filename] = parts;
return path.join('content-old', folder, subfolder, `${filename}.md`);
}
return null;
}
// Function to find new content file based on content ID
function findNewContentFile(contentId) {
const contentDir = 'content';
const files = fs.readdirSync(contentDir);
// Find file that ends with the content ID
const matchingFile = files.find(file => file.includes(`@${contentId}.md`));
if (matchingFile) {
return path.join(contentDir, matchingFile);
}
return null;
}
// Process each mapping
console.log('Starting content migration...\n');
let migratedCount = 0;
let skippedCount = 0;
for (const [topicPath, contentId] of Object.entries(migrationMapping)) {
const oldFilePath = findOldContentFile(topicPath);
const newFilePath = findNewContentFile(contentId);
if (!oldFilePath) {
console.log(`❌ Could not determine old file path for: ${topicPath}`);
skippedCount++;
continue;
}
if (!newFilePath) {
console.log(`❌ Could not find new file for content ID: ${contentId} (topic: ${topicPath})`);
skippedCount++;
continue;
}
if (!fs.existsSync(oldFilePath)) {
console.log(`❌ Old file does not exist: ${oldFilePath} (topic: ${topicPath})`);
skippedCount++;
continue;
}
try {
// Read old content
const oldContent = fs.readFileSync(oldFilePath, 'utf8');
// Write to new file
fs.writeFileSync(newFilePath, oldContent);
console.log(`✅ Migrated: ${topicPath} -> ${path.basename(newFilePath)}`);
migratedCount++;
} catch (error) {
console.log(`❌ Error migrating ${topicPath}: ${error.message}`);
skippedCount++;
}
}
console.log(`\n📊 Migration complete:`);
console.log(` Migrated: ${migratedCount} files`);
console.log(` Skipped: ${skippedCount} files`);
console.log(` Total: ${Object.keys(migrationMapping).length} mappings`);
```
### 3. Execution Steps
1. Navigate to the roadmap directory (e.g., `src/data/roadmaps/[roadmap-name]`)
2. Create the migration script as `migrate_content.cjs`
3. Run: `node migrate_content.cjs`
4. Review the migration results
5. Clean up the temporary script file
### 4. Validation
After migration:
- Verify a few migrated files have proper content (not just titles)
- Check that the content structure matches the old content
- Ensure proper markdown formatting is preserved
## File Structure Expected
```
roadmap-directory/
├── migration-mapping.json
├── content/
│ ├── file1@contentId1.md
│ ├── file2@contentId2.md
│ └── ...
└── content-old/
├── section1/
│ ├── index.md
│ ├── topic1.md
│ └── subsection1/
│ └── subtopic1.md
└── section2/
└── ...
```
## Notes
- The migration mapping uses colons (`:`) to separate nested paths
- Content files in the new structure use the pattern `filename@contentId.md`
- The script handles 1-3 levels of nesting in the old structure
- Always create the script with `.cjs` extension to avoid ES module issues

View File

@@ -0,0 +1,7 @@
# Actix
Actix is a high-performance, pragmatic web framework for Rust built on the actor model. It features powerful middleware, WebSocket support, and excellent performance benchmarks. Actix provides a flexible, feature-rich API for building web applications, APIs, and microservices with minimal boilerplate.
Visit the following resources to learn more:
- [@official@Actix](https://actix.rs/)

View File

@@ -0,0 +1,7 @@
# Arc
`Arc<T>` (Atomic Reference Counting) is a thread-safe smart pointer for sharing immutable data across multiple threads. It uses atomic operations to track reference counts, allowing multiple ownership of heap-allocated data. When the reference count reaches zero, the data is automatically cleaned up.
Learn more from the following links:
- [@article@Arc](https://doc.rust-lang.org/rust-by-example/std/arc.html)

View File

@@ -0,0 +1,10 @@
# Array
Arrays are fixed-size collections of elements of the same type stored consecutively in memory. Size must be known at compile time and cannot change. Syntax: `let arr: [type; size] = [elements];`. Example: `let nums: [i32; 3] = [1, 2, 3];`. Access elements with zero-based indexing: `arr[0]`.
Learn more from the following links:
- [@official@Rust - array](https://doc.rust-lang.org/std/primitive.array.html)
- [@article@The Array Type](https://rust-book.cs.brown.edu/ch03-02-data-types.html#the-array-type)
- [@article@Rust Array (With Examples)](https://www.programiz.com/rust/array)
- [@video@Rust Tutorial - Arrays](https://www.youtube.com/watch?v=t047Hseyj_k&t=767s)

View File

@@ -1,7 +0,0 @@
# async-std
`async-std` is a Rust library that provides an asynchronous version of the standard library. With the goal of being a drop-in replacement for Rust's standard library, it brings asynchronous programming directly into Rust's native system library, std. The most essential part inside `async-std` is an asynchronous runtime which includes IO and task scheduling. It lets you write asynchronous code that looks like synchronous code without having to worry about using future combinators or remembering to check if futures are ready. This significantly simplifies Rust's asynchronous programming model.
Visit the following resources to learn more:
- [@article@Docs.rs: async-std](https://docs.rs/async-std/latest/async_std/)

View File

@@ -1,8 +0,0 @@
# Tokio
Tokio, a Rust framework for developing applications, is used primarily for asynchronous programming that enables you to write asynchronous inputs/output, networking, and other features. Its primary function is to deliver high-performance, reliable, and easy-to-use asynchronous event-driven platform. It is built on the futures library and uses the async/await syntax of Rust for readability purposes. Tokio's 'runtime' provides I/O driver functions, scheduling and timers offering a foundation for asynchronous programming. It is designed to handle a high volume of network connections concurrently, making it ideal for building network applications.
Visit the following resources to learn more:
- [@official@Official Website](https://tokio.rs/)
- [@article@Docs.rs: Tokio](https://docs.rs/tokio/latest/tokio/)

View File

@@ -0,0 +1,7 @@
# async-std
`async-std` provides an asynchronous version of Rust's standard library, offering familiar APIs for async programming. It includes its own runtime, task scheduler, and async I/O primitives, designed as a drop-in replacement for std with async capabilities and intuitive syntax.
Visit the following resources to learn more:
- [@article@Docs.rs: async-std](https://docs.rs/async-std/latest/async_std/)

View File

@@ -0,0 +1,7 @@
# Atomic Operations and Memory Barriers
Atomic operations provide lock-free concurrency through uninterruptible operations like `load`, `store`, `swap`, and `compare_and_swap`. These low-level primitives enable thread-safe data sharing without locks, forming the foundation for higher-level concurrent abstractions and non-blocking data structures.
Learn more from the following links:
- [@article@Rust Atomics and Locks - Low-Level Concurrency in Practice](https://marabos.nl/atomics/)

View File

@@ -0,0 +1,7 @@
# Axum
Axum is a modern, ergonomic web framework built on hyper and designed for async Rust. It features excellent type safety, powerful extractors, middleware support, and seamless Tokio integration. Axum emphasizes developer experience while maintaining high performance for web services and APIs.
Visit the following resources to learn more:
[@official@Axum Documentation](https://docs.rs/axum/latest/axum/)

View File

@@ -0,0 +1,3 @@
# bevy
Bevy is a modern, data-driven game engine built in Rust featuring an ECS (Entity Component System) architecture. It supports both 2D and 3D games with modular design, custom shaders, and high performance. Bevy emphasizes developer ergonomics and provides comprehensive tools for game development.

View File

@@ -0,0 +1,7 @@
# BinaryHeap
`BinaryHeap<T>` is a priority queue implemented as a max-heap using a binary tree structure stored in an array. The largest element is always at the root, accessible via `peek()`. Supports O(log n) insertion with `push()` and removal with `pop()`. Useful for priority-based algorithms.
Learn more from the following links:
- [@official@BinaryHeap](https://doc.rust-lang.org/std/collections/struct.BinaryHeap.html)

View File

@@ -0,0 +1,9 @@
# Boolean
Rust's `bool` primitive type represents truth values with two possible states: `true` or `false`. Booleans are used in conditional statements and logical operations like `&&` (AND), `||` (OR), and `!` (NOT). When cast to integers, `true` becomes `1` and `false` becomes `0`. Example: `let is_active: bool = true;`
Learn more from the following links:
- [@video@Rust Tutorial - Booleans](https://www.youtube.com/watch?v=t047Hseyj_k&t=388s)
- [@article@The Boolean Type](https://rust-book.cs.brown.edu/ch03-02-data-types.html#the-boolean-type)
- [@official@bool - Rust](https://doc.rust-lang.org/std/primitive.bool.html)

View File

@@ -0,0 +1,8 @@
# Borrowing, References, and Slices
Borrowing allows accessing data without taking ownership. Immutable borrows (`&T`) permit multiple read-only references, while mutable borrows (`&mut T`) allow one exclusive reference that can modify data. Slices (`&[T]`, `&str`) are references to contiguous sequences, enabling safe access to portions of data.
Learn more from the following links:
- [@article@References and Borrowing](https://rust-book.cs.brown.edu/ch04-02-references-and-borrowing.html)
- [@article@The Slice Type](https://rust-book.cs.brown.edu/ch04-04-slices.html)

View File

@@ -0,0 +1,8 @@
# BTreeMap
`BTreeMap<K, V>` stores key-value pairs in a sorted binary tree structure. Keys must implement `Ord` trait and are automatically kept in sorted order. Provides O(log n) operations for insertion, removal, and lookup. Ideal when you need ordered iteration and range queries.
Learn more from the following links:
- [@article@BTreeMap](https://doc.rust-lang.org/std/collections/struct.BTreeMap.html)
- [@article@BTreeMap](https://cglab.ca/~abeinges/blah/rust-btree-case/)

View File

@@ -0,0 +1,7 @@
# BTreeSet
`BTreeSet<T>` is a sorted set of unique elements implemented using a B-tree. Elements must implement `Ord` trait and are kept in sorted order. Provides O(log n) insertion, removal, and lookup operations. Supports efficient range queries and set operations like union and intersection.
Learn more from the following links:
- [@article@Btree Set](https://doc.rust-lang.org/std/collections/struct.BTreeSet.html)

View File

@@ -0,0 +1,7 @@
# Channels
Channels enable thread communication via message passing from `std::sync::mpsc` (Multiple Producer, Single Consumer). They have `Sender` for sending data and `Receiver` for receiving. This avoids shared state concurrency issues and enables safe communication between threads without data races.
Learn more from the following links:
- [@article@Channels](https://doc.rust-lang.org/rust-by-example/std_misc/channels.html)

View File

@@ -1,6 +1,6 @@
# Character # Character
In Rust, the `char` keyword is used to denote a character type. A `char` in Rust represents a **Unicode Scalar Value**, which means it can represent a lot more than just ASCII. Accented letters, Chinese/Japanese/Korean ideographs, emoji, and zero width spaces are all valid `char` Types in Rust. It occupies in memory the same size of `u32` type, that's 4 bytes (or `32bit`) to store a single character. It is defined with single quotes like `let x: char = 'z';`. Rust's `char` type represents a Unicode Scalar Value, supporting far more than ASCII including emojis, accented letters, and various scripts. Each `char` occupies 4 bytes (32 bits) in memory and is defined using single quotes. Example: `let letter: char = 'z';` or `let emoji: char = '🦀';`
Learn more from the following links: Learn more from the following links:

View File

@@ -0,0 +1,3 @@
# clap
`clap` is Rust's most popular command-line argument parser library. It provides declarative CLI definition with automatic help generation, subcommands, validation, and error handling. Supports both builder pattern and derive macros for easy CLI app development with comprehensive features.

View File

@@ -0,0 +1,3 @@
# CLI Utilities
Rust excels at building fast, reliable command-line tools with memory safety and performance. Popular crates include `clap` for argument parsing, `structopt` for derives, and `termion` for terminal control. Rust's tooling ecosystem makes CLI development efficient and robust.

View File

@@ -1,3 +0,0 @@
# clap
`clap` is a command line argument parser for Rust. It is used for managing and parsing command line arguments and subcommands for your application. `clap` allows you to set the name, version, author, about info, and other global settings of your application. It also supports auto-generated help messages, custom errors, and is unicode compatible. It is very flexible and highly configurable and allows you to extract the needed values easily with the provided methods.

View File

@@ -0,0 +1,9 @@
# Code Organization and Namespacing
Rust organizes code through modules (`mod`) for grouping related functionality and crates (binary/library projects). Modules provide namespacing and can be nested. Crates are compilation units with a root file (`main.rs` or `lib.rs`) forming the module tree for libraries or executables.
Visit the following resources to learn more:
- [@article@Rust by Example: Modules](https://doc.rust-lang.org/rust-by-example/mod.html)
- [@article@The Rust Reference: Namespaces](https://doc.rust-lang.org/reference/names/namespaces.html)
- [@feed@Explore top posts about General Programming](https://app.daily.dev/tags/general-programming?ref=roadmapsh)

View File

@@ -0,0 +1,3 @@
# Concurrency and Parallelism
Concurrency allows tasks to run in overlapping time periods (interleaved execution), while parallelism executes multiple tasks simultaneously on different cores. Rust provides safe concurrency primitives like channels, mutexes, and atomic operations without data races, enforced at compile time.

View File

@@ -1,7 +0,0 @@
# Atomic Operations and Memory Barriers
Atomic operations in Rust are low-level types that support lock-free concurrent programming. These operations are atomic because they complete in a single operation rather than being interruptible. In Rust, atomic types provide primitive shared-memory communication between threads, and can also be used for non-blocking data structures and are supported using machine instructions directly. They form the building blocks for other, higher-level concurrency abstractions. It includes variety of atomic operations such as `store`, `load`, `swap`, `fetch_add`, `compare_and_swap` and more, which are operations performed in a single, uninterrupted step.
Learn more from the following links:
- [@article@Rust Atomics and Locks - Low-Level Concurrency in Practice](https://marabos.nl/atomics/)

View File

@@ -1,3 +0,0 @@
# Futures and Async/Await Paradigm
Futures in Rust represent values that might not have been computed yet. They are a way for the program to describe an operation that will be completed at some point in the future, or will complete asynchronously. They are a cornerstone of many async applications in Rust. A Future is an asynchronous computation that can produce a value (Ok-type) or an error (Err-type). The critical idea behind futures is that they can produce their value at some point in time, that "sometime" can be now, in the future, or never.

View File

@@ -1,3 +0,0 @@
# Concurrency and Parallelism
Concurrency and parallelism are two terms related to multitasking. In **concurrency**, tasks have the ability to run in an overlapping manner, which does not necessarily mean they run at the same exact time. It means the start and end times of the tasks intersect. On the other hand, **parallelism** is the process where several tasks are executed simultaneously. In the context of programming, especially in systems such as Rust, these concepts are exceptionally important. Understanding them is crucial to implementing complex algorithms and systems that benefit from the efficient use of resources, and most importantly, time.

View File

@@ -1,7 +0,0 @@
# Threads, Channels, and Message Passing
Threads are the smallest unit of computing that can be scheduled by an operating system. They live in the context of a process, and each thread within a process shares the process's resources including memory and file handles. In Rust, the `std::thread` module allows you to have direct control over threads. This model of concurrency is known as 1:1, mapping one operating system thread to one language thread. You can write concurrent programs in Rust using threads in a similar way as most other languages. You start threads with `std::thread::spawn` and wait for them to finish with `join`.
Learn more from the following links:
- [@article@Rust Atomics and Locks - Low-Level Concurrency in Practice](https://marabos.nl/atomics/)

View File

@@ -0,0 +1,3 @@
# Covariant and Contravariant Lifetimes
Variance describes how subtyping relationships change when types are nested. Covariant types preserve ordering (`&'long T` is subtype of `&'short T`), contravariant reverses it, invariant requires exact matches. Affects how lifetimes work with references, boxes, and function parameters.

View File

@@ -1,3 +0,0 @@
# Cryptography
Cryptography is a method of storing and transmitting data in a particular form so that only those for whom it is intended can read and process it. This practice is widely used in securing modern communications and protecting data from theft or tampering. It bases itself on the fundamentals of mathematics to transform data into a format that is unreadable without a key. In its simplest form, it involves just two steps: encryption and decryption. Encryption is the process of converting readable data into an unreadable format using an algorithm and a key. Decryption is the reverse of encryption; it turns the unreadable data back into its original form with the use of the matching key.

View File

@@ -0,0 +1,3 @@
# Cryptography
Cryptography involves securing data through encryption (making readable data unreadable) and decryption (reversing the process). Rust offers crypto libraries like `ring`, `sodiumoxide`, and `rust-crypto` for hashing, symmetric/asymmetric encryption, and digital signatures with memory-safe implementations.

View File

@@ -0,0 +1,7 @@
# Custom Error Types and Traits
Custom error types use `enum` to define specific error variants with attached data. Implement `Debug`, `Display`, and optionally `std::error::Error` traits for proper error handling integration. Libraries like `thiserror` provide derive macros to simplify custom error creation and formatting.
Visit the following resources to learn more:
- [@article@Rust by Example: Defining an error type](https://doc.rust-lang.org/rust-by-example/error/multiple_error_types/define_error_type.html)

View File

@@ -0,0 +1,3 @@
# Database and ORM
ORMs (Object-Relational Mapping) provide abstraction layers between Rust code and SQL databases. Popular Rust ORMs include Diesel (compile-time safety), SQLx (async with compile-time query checking), and Sea-ORM. They eliminate raw SQL writing while maintaining type safety and performance.

View File

@@ -1,10 +0,0 @@
# Diesel
Diesel is a safe, extensible ORM (Object-Relational Mapping) and query builder for Rust. Diesel is designed to help you move between database schema, SQL queries, and your data in your application with safety and ease. It provides a high-level API and avoids the need to manage database connections manually. It simplifies SQL interfacing, ensuring type safety and connection handling right from the box. Diesel supports PostgreSQL, SQLite, and MySQL databases.
Visit the following resources to learn more:
- [@official@Diesel](https://diesel.rs/)
- [@opensource@Repository](https://github.com/diesel-rs/diesel)
- [@article@Docs.rs: Diesel](https://docs.rs/diesel/latest/diesel/)
- [@video@YouTube](https://www.youtube.com/watch?v=tRC4EIKhMzw)

View File

@@ -1,3 +0,0 @@
# Database and ORM
ORM stands for Object-Relational Mapping. It's a programming technique used to convert data between incompatible type systems using object-oriented programming languages. In Rust, the database ORM provides an abstraction for dealing with SQL queries, where you don't need to write raw SQL queries. Instead, you can create, delete and manipulate database records using Rust's interface. It transforms data from a relational database model (tables, rows, and columns) into objects that can be used in code. Important database ORMs in Rust include Diesel, sqlx, and others.

View File

@@ -1,8 +0,0 @@
# sqlx
`SQLx` is an extensible, async, pure-Rust SQL toolkit and ORM that provides a suite of macros and builders for interacting with databases. It enables you to interact directly with your database without having to write SQL-statements, but with the strong typing of Rust. SQLx supports PostgreSQL, MySQL, SQLite, and MSSQL and is compatible with the `tokio` and `async-std` async runtimes. SQLx ensures compile-time checking of your SQL queries, which significantly reduces runtime errors due to malformed SQL.
Visit the following resources to learn more:
- [@opensource@Repository](https://github.com/launchbadge/sqlx)
- [@article@Docs.rs: sqlx](https://docs.rs/sqlx/latest/sqlx/)

View File

@@ -1,3 +0,0 @@
# Debugging
"Debugging" is a critical process in software development that involves identifying, isolating, and fixing (or "debugging") problems or errors in a computer program or software code. In Rust, the Rust compiler plays a big part in this process because of its strictness and propensity for compile-time error checking. Rust also provides various debugging tools such as `rust-gdb` and `rust-lldb`. Moreover, the language comes with standard library macros like `debug!` and `println!` for tracing and debugging. Additionally, for a thorough debugging experience, there are debugging variables that provide a backtrace of a system's state, and tests that can help you ensure that your system works as expected.

View File

@@ -0,0 +1,3 @@
# Debugging
Rust provides excellent debugging support through `rust-gdb` and `rust-lldb` debuggers, along with built-in macros like `println!`, `dbg!`, and `debug!`. The strict compiler catches many bugs at compile-time, while runtime debugging is enhanced by panic backtraces and comprehensive error messages.

View File

@@ -0,0 +1,8 @@
# Declarative Macros with macro_rules!
Declarative macros use `macro_rules!` for pattern-based code generation at compile time. They match syntax patterns and expand into replacement code, enabling code reuse without runtime overhead. More limited than procedural macros but simpler to write and understand.
Visit the following resources to learn more:
- [@article@Rust Book: Macros](https://doc.rust-lang.org/book/ch19-06-macros.html)
- [@article@Macros by Example](https://doc.rust-lang.org/reference/macros-by-example.html)

View File

@@ -0,0 +1,7 @@
# Deep Dive: Stack vs Heap
Stack memory stores fixed-size data with automatic allocation/deallocation following LIFO order - fast but limited. Heap memory stores dynamic-size data with manual management - slower but flexible. Rust's ownership system ensures memory safety across both, with stack being default and heap accessed via smart pointers.
Learn more from the following links:
- [@article@The Stack and the Heap](https://web.mit.edu/rust-lang_v1.25/arch/amd64_ubuntu1404/share/doc/rust/html/book/first-edition/the-stack-and-the-heap.html)

View File

@@ -0,0 +1,8 @@
# Dependency Management with Cargo.toml
Cargo manages Rust projects and dependencies through `Cargo.toml` files. Dependencies are listed in `[dependencies]` sections with crate names and semantic version specifications. Cargo automatically downloads, builds, and manages external libraries (crates) from crates.io or other sources.
Visit the following resources to learn more:
- [@article@Rust Blog: Cargo](https://blog.rust-lang.org/2016/05/05/cargo-pillars.html)
- [@article@Rust by Example: Dependencies](https://doc.rust-lang.org/rust-by-example/cargo/deps.html)

View File

@@ -0,0 +1,10 @@
# Diesel
Diesel is a safe, extensible ORM and query builder for Rust that provides compile-time guarantees against SQL injection and type mismatches. It supports PostgreSQL, MySQL, and SQLite with high-level APIs for database operations while maintaining excellent performance and type safety.
Visit the following resources to learn more:
- [@official@Diesel](https://diesel.rs/)
- [@opensource@Repository](https://github.com/diesel-rs/diesel)
- [@article@Docs.rs: Diesel](https://docs.rs/diesel/latest/diesel/)
- [@video@YouTube](https://www.youtube.com/watch?v=tRC4EIKhMzw)

View File

@@ -0,0 +1 @@
# Documenting with `rustdoc`

View File

@@ -0,0 +1,7 @@
# Domain-Specific Languages (DSLs) in Rust
DSLs are specialized programming languages for specific domains. Rust macros enable creating DSLs by manipulating syntax trees and defining custom syntax patterns. This allows extending Rust's language capabilities for specialized applications like game development, configuration, or domain-specific tasks.
Visit the following resources to learn more:
- [@article@Rust by Example: Domain Specific Languages (DSLs)](https://doc.rust-lang.org/rust-by-example/macros/dsl.html)

View File

@@ -0,0 +1,3 @@
# Embedded and Systems
Rust excels in embedded systems programming for microcontrollers and real-time applications. Its zero-cost abstractions, memory safety, and low-level control make it ideal for resource-constrained environments. Popular for IoT devices, firmware, and system-level programming without garbage collection overhead.

View File

@@ -1,3 +0,0 @@
# Embedded and Systems
"Embedded" in the world of Rust programming refers to the use of Rust in embedded systems. These are computer systems with a dedicated function within a larger mechanical or electrical system, often with real-time computational constraints. They are used in a wide range of applications from appliances to vehicles to vending machines and all sorts of industrial applications. Rust's zero-cost abstractions, high-level ergonomics, and low-level control make it an excellent language to use for embedded systems. By using Rust, developers can write extremely low-level code, such as operating system kernels or microcontroller applications.

View File

@@ -1,7 +0,0 @@
# Custom Error Types and Traits
In Rust, you can define your own types of errors using the `enum` construct. This gives you the ability to specify different types of errors that your code can encounter, and attach additional information to them. To make your custom error type compatible with the rest of Rust's error handling machinery, you need to implement two traits: `std::fmt::Debug` and `std::fmt::Display`. There is also a third trait, `std::error::Error`, which can provide backtraces and the ability to have chained errors or causes. Furthermore, the `thiserror` library provides a convenient way to define custom error types with a simple annotation.
Visit the following resources to learn more:
- [@article@Rust by Example: Defining an error type](https://doc.rust-lang.org/rust-by-example/error/multiple_error_types/define_error_type.html)

View File

@@ -1,8 +0,0 @@
# Option & Result Enumerations
`Option` is an enumeration, also known as an `enum`, in Rust with two variants: `Some(T)` and `None`. It is a flexible and safe alternative to using `null` values or exceptions for indicating that a value might not be present. If a function may not return a value for all possible input, it should return an `Option` value. `Some(T)` variant contains the valid value of type `T` and `None` variant indicates the absence of a value. You can perform various operations on `Option` values, such as method chaining and pattern matching, to effectively handle both states (value present or absent). The `Option` enum encourages you to consciously deal with the possibility of missing values and helps prevent unforeseen runtime errors.
Visit the following resources to learn more:
- [@article@Rust by Example: Option & unwrap](https://doc.rust-lang.org/rust-by-example/error/option_unwrap.html)
- [@article@Rust by Example: Result](https://doc.rust-lang.org/rust-by-example/error/result.html)

View File

@@ -1,7 +0,0 @@
# Propagating Errors and `?` Operator
Propagating errors in Rust is about passing the error information from the function that failed to the function that called it. Using the `?` operator is one way to achieve this. This operator can only be used in functions that return `Result` or `Option` or another type that implements `std::ops::Try`. If the value of the `Result` is `Ok`, the value inside the `Ok` will get returned. If the value is `Err`, the `Err` will be returned from the whole function. Consequently, the error gets propagated to the calling function.
Visit the following resources to learn more:
- [@article@Rust Book: Recoverable Errors with Result](https://doc.rust-lang.org/book/ch09-02-recoverable-errors-with-result.html)

View File

@@ -0,0 +1,3 @@
# Explicit Lifetime Annotations
Explicit lifetime annotations use syntax like `'a` to specify relationships between reference lifetimes in function signatures. Required when the compiler can't infer lifetimes automatically. Example: `fn longest<'a>(x: &'a str, y: &'a str) -> &'a str` ensures all references live equally long.

View File

@@ -1,3 +0,0 @@
# File Parsing
Rust can be used to parse files for the purpose of data extraction, reverse engineering and more using libraries such as `nom`, `pdf-rs`, and `html-parser`. In conjunction with networking libraries like `http`, file parsing libraries can be used to make efficient, powerful web scrapers, while libraries like `pdf-rs` can be used to analyze large quantities of files in bulk for data extraction, classification and machine learning.

View File

@@ -1,8 +0,0 @@
# pdf-rs
pdf-rs is a crate that allows the developer to parse and manipulate data and metadata such as embedded text and images from PDF files using Rust. You can learn more about pdf-rs from the official documentation.
Learn more from the following resources:
- [@official@PDF Documentation](https://docs.rs/pdf/latest/pdf/)
- [@opensource@pdf-rs](https://github.com/pdf-rs/pdf)

View File

@@ -0,0 +1,3 @@
# Futures and Async/Await Paradigm
Futures represent asynchronous computations that produce values or errors eventually. The `async/await` syntax provides ergonomic programming over futures, allowing asynchronous code to look synchronous. Futures are lazy and must be polled to make progress, forming the foundation of Rust's async ecosystem.

View File

@@ -1,3 +0,0 @@
# bevy
Bevy is a simple, data-driven game engine built in Rust. It emphasizes high performance with its ECS (Entity Component System) architecture and provides the tools needed to build immersive interactive real-time systems. With modern design principles, Bevy enables developers to create rich interactive systems without complex boilerplate. In addition, Bevy provides flexibility with its modular and extensible structure capable of supporting a wide range of different types of games and multimedia applications. It also allows users to build both 2D and 3D games with support for custom shaders and materials.

View File

@@ -1,3 +0,0 @@
# Game Development
"Game development" is the process of designing, programming, and testing a video game. It involves various disciplines such as game design, which covers gameplay and story, arts and animation to ensure aesthetics and appeal, and programming for game interactions and mechanics. Game development can be approached using different tools and languages, and "Rust" has emerged as a powerful option thanks to its performance and safety aspects. It can be used to create both 2D and 3D games, and there are several libraries and frameworks in Rust meant specifically for game development, such as Amethyst and ggez. The process usually involves a game engine where most of the game contents are processed and a renderer where the game's visual representation is produced.

View File

@@ -0,0 +1,3 @@
# Game Development
Rust's performance and memory safety make it excellent for game development. Popular engines and frameworks include Bevy (ECS-based), Macroquad, ggez, and Fyrox. Rust handles both 2D and 3D games efficiently, with growing ecosystem support for graphics, audio, and physics.

View File

@@ -0,0 +1,8 @@
# Advanced Generics and Type-level Programming
Advanced generics in Rust include `where` clauses for complex bounds, `?Sized` for unsized types, associated types, and higher-kinded types. These enable sophisticated type-level programming, allowing precise control over generic constraints and enabling powerful abstractions while maintaining zero-cost performance.
Visit the following resources to learn more:
- [@article@Book: Generics](https://doc.rust-lang.org/book/ch10-01-syntax.html)
- [@article@Rust by Example: Generics](https://doc.rust-lang.org/rust-by-example/generics.html)

View File

@@ -1,3 +0,0 @@
# GUI Development
"GUI Dev" or Graphical User Interface Development is a significant aspect of software development which focuses on creating visually engaging and intuitive user interfaces. It includes designing the layout, look, and feel of an application through elements such as buttons, icons, images, input fields, and other widgets. In Rust, GUI Development can be done using numerous libraries like 'conrod', 'druid', or 'iced'. Each of these libraries contains unique ways to deal with user input, event handling, and drawing graphics. Ultimately, good GUI design can lead to an improved user experience by making software easy and enjoyable to interact with.

View File

@@ -1,7 +0,0 @@
# tauri
`Tauri` is an open-source framework for building lightweight, secure, and cross-platform desktop applications using web technologies. It allows developers to create native apps with HTML, CSS, and JavaScript while leveraging Rust for the backend and core functionality. Tauri offers smaller bundle sizes compared to Electron, enhanced security features, and deep system integration. It supports Windows, macOS, and Linux, and provides a unified API for accessing native features across different operating systems. Tauri's architecture allows for custom compile-time optimizations and the use of any front-end framework, making it a flexible and efficient choice for desktop app development.
Learn more from the following resources:
- [@official@Tauri Website](https://tauri.app)

View File

@@ -0,0 +1,3 @@
# GUI Development
Rust offers several GUI frameworks for desktop applications including Tauri (web-based), Iced (inspired by Elm), Druid, GTK-rs, and Egui. These provide cross-platform support for creating native desktop applications with modern UI patterns and performance benefits of Rust.

View File

@@ -0,0 +1,10 @@
# Hashmap
`HashMap<K, V>` stores key-value pairs using hashing for fast lookups, insertions, and removals. Keys must be unique; duplicate keys replace old values. Rust uses cryptographically strong hashing for security. Items are unordered. Example: `HashMap::new()` or `HashMap::from([("key", "value")])`.
Learn more from the following links:
- [@official@HashMap in std::collections - Rust](https://doc.rust-lang.org/std/collections/struct.HashMap.html)
- [@official@Storing Keys With Associated Values In Hash Maps](https://doc.rust-lang.org/book/ch08-03-hash-maps.html?highlight=hashmap#storing-keys-with-associated-values-in-hash-maps)
- [@article@Hash Table](https://en.wikipedia.org/wiki/Hash_table)
- [@video@HashMaps: key-value stores in Rust](https://www.youtube.com/watch?v=BfmSYuDdg8Q)

View File

@@ -0,0 +1,9 @@
# Hashset
`HashSet<T>` is a collection of unique elements using hash-based storage for fast lookups, insertions, and deletions. No duplicates are allowed and elements are unordered. Provides methods like `insert()`, `contains()`, and `remove()`. Example: `let mut set = HashSet::new(); set.insert("value");`
Learn more from the following links:
- [@official@HashSet in std::collections - Rust](https://doc.rust-lang.org/std/collections/struct.HashSet.html)
- [@article@Hashset](https://doc.rust-lang.org/rust-by-example/std/hash/hashset.html)
- [@video@Rust HashSet Collection Type](https://www.youtube.com/watch?v=KYw3Lnf0nSY&t=1440s)

View File

@@ -0,0 +1,8 @@
# hyper
Hyper is a fast, safe HTTP client/server library for Rust built on Tokio for async I/O. It supports HTTP/1 and HTTP/2 with automatic protocol negotiation. Hyper provides low-level HTTP primitives that power many higher-level web frameworks and serves as the foundation for efficient network programming.
Visit the following resources to learn more:
- [@official@Official Website](https://hyper.rs/)
- [@article@Docs.rs: Hyper](https://docs.rs/hyper/latest/hyper/)

View File

@@ -1,3 +0,0 @@
# Rust Developer Roadmap
Rust is a systems programming language that runs blazingly fast, prevents segfaults, and guarantees thread safety. This roadmap covers the essential skills and concepts needed to become proficient in Rust development, from basic syntax to advanced topics like async programming, web development, and embedded systems.

View File

@@ -1,11 +0,0 @@
# Memory Safety and Zero-Cost Abstractions
Rust is a system programming language that runs blazingly fast, prevents segfaults, and guarantees thread safety. It is graced with the feature of "memory safety without garbage collection," an attribute that makes Rust one of a kind. "Memory safety" is ensuring that software is not causing any memory leaks or dangling pointers while accessing the system's memory. In Rust, memory safety is accomplished through a system called ownership, with a set of rules that the compiler checks at compile time. This ownership system eliminates the need for garbage collection or manual memory management, thus ensuring swift execution of software and a safer memory environment. Rust's memory management features even support concurrent programming, providing options for shared and mutable state access that ensure thread safety while reducing the risk of thread unsafety.
<!-- Adding content on Zero-cost Abstraction -->
Zero-cost abstraction is another key concept Rust implements. In general, abstractions in programming languages allow code to be written at a high level (like in Python), while being able to run at a low level (like in C). However, these abstractions often come with a runtime cost. In contrast, Rust aims to provide many useful abstractions, such as iterators and closures, that don't sacrifice runtime performance. This means you can write high-level code in Rust, and the Rust compiler will optimize it to run as fast as manually written low-level code.
Learn more from the following resources:
- [@video@This Is How Rust Stops Memory Leaks](https://www.youtube.com/watch?v=DJdUjjOmyx8)

View File

@@ -1,10 +0,0 @@
# Constructs
In Rust, "constructs" refer to different elements used to build the structure of the program. Constructs includes variables, functions, data types, control flow statements, and more.
- **Variables** store data, and their immutable or mutable status is determined at their declaration with `let` and `let mut`, respectively.
- **Functions** are reusable blocks of code defined by the `fn` keyword.
- **Data types** in Rust are static and must be declared upfront. These include simple _primitive_ types, like integers, booleans (`bool`), and floats, as well as _complex_ types like arrays, tuples, all the custom types you declare yourself, and many more types you might use from Rust's standard library or community crates you download.
- **Control flow** structures help direct the flow of code execution. These include `if`, `else`, `loop`, `while`, and `for` blocks, to name a few. Exception handling in Rust leverages the `Result<T, E>` and `Option<T>` enums alongside the `match` construct's ability to perform concise pattern matching.
As a Rust programmer, you'll utilize many of the language's constructs like the ones above. These pieces come together at your fingertips to structure your program in a safe and efficient manner.

View File

@@ -1,7 +0,0 @@
# Arc
`Arc` in Rust stands for "Atomic Reference Counting". It is a thread-safe reference-counting type used for sharing immutable data between multiple parts of the system. With `Arc`, we can have multiple references to the same data which is useful for concurrent programming. When the last reference to a type is gone, the `Arc` will clean up the underlying data. Unlike `Rc` (Reference Counting), which is single-threaded, `Arc` uses atomic operations for incrementing and decrementing the reference count hence making it safe to share across threads.
Learn more from the following links:
- [@article@Arc](https://doc.rust-lang.org/rust-by-example/std/arc.html)

View File

@@ -1,10 +0,0 @@
# Array
In Rust, an `array` is a collection of elements of the same type, organized consecutively in memory. Unlike some other data structures in Rust, the size of an array must be known at compile time. This gives it a distinct advantage in memory efficiency. The size of the array cannot be changed after it has been declared. The syntax to declare an array in Rust is as follows: `let array_name: [type; size] = [elements];`. Here, `type` represents the data type of the elements, `size` is the number of elements and `elements` are the data held in the array. For example: `let numbers: [i32; 5] = [1, 2, 3, 4, 5];`. Elements in an array can be accessed using their indices, starting from 0. For instance, `numbers[0]` will return the first element `1` in the `numbers` array.
Learn more from the following links:
- [@official@Rust - array](https://doc.rust-lang.org/std/primitive.array.html)
- [@article@The Array Type](https://rust-book.cs.brown.edu/ch03-02-data-types.html#the-array-type)
- [@article@Rust Array (With Examples)](https://www.programiz.com/rust/array)
- [@video@Rust Tutorial - Arrays](https://www.youtube.com/watch?v=t047Hseyj_k&t=767s)

View File

@@ -1,7 +0,0 @@
# BinaryHeap
A `Binary Heap` is a complete binary tree which is either Min Heap or Max Heap. In a Max Binary Heap, the key at root must be maximum among all other keys present in Binary Heap. The same property must be recursively true for all nodes in Binary Tree. Min Binary Heap is similar to Max Binary Heap. But in a Min Binary Heap, the key at root must be minimum among all other keys present in Binary Heap. This property must be recursively true for all nodes in Binary Tree. Binary Heaps have efficient implementations on arrays.
Learn more from the following links:
- [@official@BinaryHeap](https://doc.rust-lang.org/std/collections/struct.BinaryHeap.html)

View File

@@ -1,9 +0,0 @@
# Boolean
`Boolean` in Rust is a primitive data type that encapsulates the truth value. It is represented by `bool` keyword and can hold two values either `true` or `false`. If you cast a bool into an integer, `true` will be `1` and `false` will be `0`. Operations like logical `AND (&&)`, logical `OR (||)`, and logical `NOT (!)` can be performed on these types of values. Boolean is primarily used in conditional statements like `if`, `while` etc. For example, `let is_raining: bool = true;` where `is_raining` is a boolean variable holding the value `true`.
Learn more from the following links:
- [@video@Rust Tutorial - Booleans](https://www.youtube.com/watch?v=t047Hseyj_k&t=388s)
- [@article@The Boolean Type](https://rust-book.cs.brown.edu/ch03-02-data-types.html#the-boolean-type)
- [@official@bool - Rust](https://doc.rust-lang.org/std/primitive.bool.html)

View File

@@ -1,8 +0,0 @@
# BTreeMap
In Rust, `BTreeMap` is a generic collection that stores data in a sorted tree structure. More specifically, it uses a self-balancing binary search tree (a type of `B+-tree`). `BTreeMap`s implement the `Map` trait, including methods such as `get`, `insert`, `remove`, and many others. The data stored in a `BTreeMap` will be sorted by key, which allows efficient lookup, insertions, and removals. The keys of the `BTreeMap` must implement the `Ord` trait, which means they must be orderable. Because `BTreeMap`s store data in a sorted order, the iteration of keys and values will be in sorted order as well.
Learn more from the following links:
- [@article@BTreeMap](https://doc.rust-lang.org/std/collections/struct.BTreeMap.html)
- [@article@BTreeMap](https://cglab.ca/~abeinges/blah/rust-btree-case/)

View File

@@ -1,7 +0,0 @@
# BTreeSet
`BTreeSet` in Rust is a data structure that implements a set backed by a BTree. Its functionality is similar to that of other set data structures in that it maintains a collection of unique elements and allows for operations like insertion, removal, and querying. But the elements in a `BTreeSet` are sorted according to an ordering relation, which may be customized by the user. The sorting enables efficient range queries as well as other operations such as finding the minimum or maximum element.
Learn more from the following links:
- [@article@Btree Set](https://doc.rust-lang.org/std/collections/struct.BTreeSet.html)

View File

@@ -1,7 +0,0 @@
# Channels
Channels in Rust allow communication between threads. They are a programming paradigm that is part of the message passing concurrency model. Channels are used to send and receive values between threads, ensuring thread safety by avoiding shared state. Rust channels have two parts - `Sender` and `Receiver`. `Sender` is used for sending data, and `Receiver` is used to read the data. This model follows the 'multiple producer, single consumer' rule, meaning it can have multiple sending ends but only one receiving end. Channels in Rust are provided by the `std::sync::mpsc` module, where mpsc stands for Multiple Producer, Single Consumer.
Learn more from the following links:
- [@article@Channels](https://doc.rust-lang.org/rust-by-example/std_misc/channels.html)

View File

@@ -1,10 +0,0 @@
# Hashmap
The `HashMap` in Rust is part of the standard library's collections framework and it's a generic collection of key-value pairs. It allows for the quick lookup, insertion, and removal of items using hashing. A `HashMap<K, V>` holds a mapping of keys of type `K` to values of type `V`. The keys are unique and when a key gets inserted for the second time with a different value, the new value replaces the old value. Rust's `HashMap` uses a cryptographically strong hashing algorithm which can help avoid denial-of-service (DoS) attacks. It is however not ordered, so items may not be in the same order as they were inserted.
Learn more from the following links:
- [@official@HashMap in std::collections - Rust](https://doc.rust-lang.org/std/collections/struct.HashMap.html)
- [@official@Storing Keys With Associated Values In Hash Maps](https://doc.rust-lang.org/book/ch08-03-hash-maps.html?highlight=hashmap#storing-keys-with-associated-values-in-hash-maps)
- [@article@Hash Table](https://en.wikipedia.org/wiki/Hash_table)
- [@video@HashMaps: key-value stores in Rust](https://www.youtube.com/watch?v=BfmSYuDdg8Q)

View File

@@ -1,9 +0,0 @@
# Hashset
`HashSet` in Rust is a collection of unique elements. It's a data structure which stores details in the form of key and value, and it uses `hashing` to store elements. It's implemented as a `hash table`, as it makes use of a hasher to make the structure more secure against collision attacks. A `HashSet` only contains keys, associating the value portion of the map with a dummy unit. The value of `HashSet` returns an iterator over the elements of the set and these elements are arbitrary and not in any specific order.
Learn more from the following links:
- [@official@HashSet in std::collections - Rust](https://doc.rust-lang.org/std/collections/struct.HashSet.html)
- [@article@Hashset](https://doc.rust-lang.org/rust-by-example/std/hash/hashset.html)
- [@video@Rust HashSet Collection Type](https://www.youtube.com/watch?v=KYw3Lnf0nSY&t=1440s)

View File

@@ -1,11 +0,0 @@
# Data Structures
In Rust, there are different types of data structures for organizing and storing data. Some of the primary types include:
- **Structures (structs)**: These are custom data types that allow you to combine multiple related values of different types. Structs implement methods and can also maintain private fields. Structs come in three types: classic C-style structs, tuple structs, and unit structs.
- **Tuples**: These are a sequence of fixed-size elements of possibly differing types. The elements of a tuple can be accessed using dot notation followed by the index starting from 0.
- **Enums (enumerations)**: These are data structures that allow you to define a type by enumerating its possible variants. Enum variants can be simple values or complex ones with fields.
- **Arrays** and **Vectors**: These are collections of items with the same type. An array is fixed-sized, while a vector can grow or shrink its size. Arrays and vectors store elements in contiguous memory locations.
- **Hash Maps**: A Hash Map keeps track of elements in key-value pairs, similar to a dictionary or a JavaScript object. They are great for quick lookups.
The Rust language also provides powerful reference and borrowing mechanism to control memory, data read/write access, and mutation to avoid problems like data races in concurrent scenarios.

View File

@@ -1,8 +0,0 @@
# LinkedList
The **Linked List** in Rust is a sequence of nodes where each node consists of a value and a pointer/reference to the next node in the sequence. Linked Lists are primarily used for implementing higher level data structures such as stacks, queues and associative arrays. Rust's `std::collections` provides a `LinkedList` struct that is a doubly-linked list with O(1) insertion and removal at both the front and back, but with O(n) indexing.
Learn more from the following links:
- [@official@LinkedList in std::collections - Rust](https://doc.rust-lang.org/std/collections/struct.LinkedList.html)
- [@opensource@Too Many Linked Lists](https://rust-unofficial.github.io/too-many-lists/)

View File

@@ -1,7 +0,0 @@
# Mutex
`Mutex` or "Mutual Exclusion" in Rust is a concurrency primitive that is used to protect shared data from being concurrently accessed by multiple threads. When one thread starts using a `Mutex`, other threads have to wait until the Mutex is unlocked. When a thread has finished handling the shared data, it should unlock the `Mutex` to allow other threads to access the shared data. If not properly handled, it could lead to a software deadlock or other timing-related issues. Rust's Mutex has a built-in safeguard against these problems if a thread that is holding a Mutex crashes, Rust will automatically unlock the Mutex.
Learn more from the following links:
- [@article@Mutex](https://doc.rust-lang.org/std/sync/struct.Mutex.html)

View File

@@ -1,7 +0,0 @@
# Queue
In Rust, a Queue is another important linear data structure which follows a particular order in which the operations are performed. The order given to the elements follows the FIFO (First In First Out) approach. There are no direct standard library data structures meant solely to act as a Queue in Rust, but we can obtain queue-like behaviors using other provided data structures. More commonly, the VecDeque structure is used as a Queue. It supports constant time element insertion and removal at both ends. The 'push_back' and 'pop_front' functions essentially form a Queue structure.
Learn more from the following links:
- [@official@Queues](https://docs.rs/queues/latest/queues/)

View File

@@ -1,7 +0,0 @@
# Rc
`Rc` stands for Reference Counting, a data type in Rust that allows multiple owners for the same data on the heap while keeping track of the number of references to that data. If there are zero references to data, the value can be cleaned up without any references becoming invalid. Avoiding these problems comes at the cost of some memory overhead, because `Rc` keeps track of the total number of references which means it needs to allocate memory to keep the count.
Learn more from the following links:
- [@article@rct - The Reference Counted Smart Pointer](https://doc.rust-lang.org/book/ch15-04-rc.html#rct-the-reference-counted-smart-pointer)

View File

@@ -1,7 +0,0 @@
# RwLock
`RwLock` in Rust stands for Read/Write lock, which is a type of synchronization primitive. It is an advanced version of the Mutex data structure. Unlike Mutex, which only allows one thread to access the data, `RwLock` allows multiple threads to read data at the same time but only one thread to write. If a thread is writing, no other thread can read or write. The syntax for declaring `RwLock` is `let lock = RwLock::new(value)`. Please remember that a potential downside of `RwLock` is lock contention, making sure to properly manage read-write access. The appropriate use of `RwLock` can enable better performance for workloads that involve heavy reading.
Learn more from the following links:
- [@article@RwLock](https://doc.rust-lang.org/std/sync/struct.RwLock.html)

View File

@@ -1,7 +0,0 @@
# Stack
The **Stack** is a fundamental data structure in Rust, which is based on the principle of Last-In-First-Out (LIFO). In other words, elements that are added last are the first ones to be removed. This is functionally similar to a real-world stack, such as a stack of plates. One key aspect of stacks in Rust is that they are bounded to a certain size at compile-time. This implies that stack size does not grow or shrink dynamically. In Rust, function calls are operated using stack with each call pushing a new stack frame to the end, and each return statement popping one off. Stack Overflow occurs when too much of the stack is used.
Learn more from the following links:
- [@official@Box, Stack and Heap](https://doc.rust-lang.org/rust-by-example/std/box.html)

View File

@@ -1,11 +0,0 @@
# String
In Rust, `String` is a growable, mutable, owned, UTF-8 encoded string type. When Rustaceans refer to 'strings' in Rust, they usually mean the `String` and the string slice `str` types, not just one of those types. Both types are UTF-8 encoded. A `String` in Rust is similar to a string in other languages, but is not null-terminated at the end. Creation of a `String` can be done from a literal string with `String::from("Hello, world!")` or by converting a string slice with `"Hello, world!".to_string()`. String concatenations and manipulations are achieved via a multitude of methods such as `push_str()`, `push()`, `+` operator, `format!()` macro, etc.
Learn more from the following links:
- [@official@String in std::string - Rust](https://doc.rust-lang.org/std/string/struct.String.html)
- [@official@str - Rust](https://doc.rust-lang.org/std/primitive.str.html)
- [@official@What Is a String?](https://doc.rust-lang.org/book/ch08-02-strings.html?highlight=String#what-is-a-string)
- [@article@Rust String (With Examples)](https://www.programiz.com/rust/string)
- [@video@All Rust string types explained](https://www.youtube.com/watch?v=CpvzeyzgQdw&pp=ygUOc3RyaW5nIGluIHJ1c3Q%3D)

View File

@@ -1,9 +0,0 @@
# Tuple
In Rust, a **Tuple** is a type of data structure that holds a finite number of elements, each having potentially different types. Elements in a tuple are accessed using a dot (`.`) followed by the index of the value we want to get. For example, to declare a tuple that includes a `32-bit integer`, a `single-byte unsigned integer`, and a `floating point number`, we would write `let my_tuple: (i32, u8, f64) = (500, 2, 20.5);` The index of elements in a tuple start from `0`. So, to access the first element, use `my_tuple.0`, the second element `my_tuple.1`, and so on. Tuples can also be used for multiple declarations and assignments. Tuples are particularly useful when you want to group together items of different types.
Learn more from the following links:
- [@official@Tuple - Rust](https://doc.rust-lang.org/std/primitive.tuple.html)
- [@article@The Tuple Type](https://rust-book.cs.brown.edu/ch03-02-data-types.html#the-tuple-type)
- [@video@Rust Tutorial - Tuples](https://www.youtube.com/watch?v=t047Hseyj_k&t=506s)

Some files were not shown because too many files have changed in this diff Show More