Skip to content

Quackers71/rust

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

94 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Rust

Rust Courses

Rust Crash Course | Rustlang via Traversy Media

Building a Rust App with Yew! via Let's Get Rusty

Learn Rust Programming - Complete Course 🦀

Other Rust content YT channels

No Boilerplate - Rust for the impatient > https://youtu.be/br3GIIQeefY?si=gctO03OJLoww24JH
Let's get Rusty - All Rust features explained > https://youtu.be/784JWR4oxOI?si=jSpk1ZTIsRa6m9Vq
The Dev Method - Rust: Intro and setting up your first project > https://youtu.be/pGh-0cMvH5g?si=tFknUYh0r8udO1NG

Online Documentation Links

Install Rust and Cargo

IDE & Setup Stuff - VSCODE

Commands for Rust App with Yew!

rustc --version
rustup target add wasm32-unknown-unknown
cargo install trunk
# Output : Installed package `trunk v0.16.0` (executable `trunk`)
To start the app run :
trunk serve
# Then goto localhost:8080

Rust Fundamentals | PluralSight - https://www.pluralsight.com/courses/rust-fundamentals

Rust-lang.org Setup

https://www.rust-lang.org/learn/get-started

- curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
# 'option 1'

Then restart the terminal

Main Commands and Rust Language

rustup --version
rustup update
rustc --version
cargo --version

mkdir rust_sandbox
cargo init
cargo run
cargo build
cargo build --release

Core Concepts


Variables

Variables hold primitive data or references to data
Variables are immutable by default
Rust is a block-scoped language

Data Types

Primitive Types--
Integers: u8, i8, u16, i16, u32, i32, u64, i64, u128, i128 (number of bits they take in memory)
Floats: f32, f64
Boolean (bool)
Characters (char)
Tuples
Arrays

An unsigned number (u32) contains just zero or positive values, whereas a signed number (i32)
has both positive and negative numbers along with the value zero.


Rust is a statically typed language, which means that it must know the types of all
variables at compile time. However, the compiler can usually infer what type we want to
use based on the value and how we use it.

Strings

Primitive str = Immutable fixed-length string somewhere in memory
String = Growable, heap-allocated data structure - Use when you need to modify or own string data

Tuples

Tuples group together values of different types
Max 12 elements

Arrays

Arrays - Fixed list where elements are the same data types

Vectors

Vectors - Resizable arrays

Conditionals

Conditionals - used to check the condition of something and act on the result

Loops

Loops - used to iterate until a condition is met

Functions

Functions - used to store block of code for re-use

Reference Pointers

Reference Pointers - Point to a resource in memory

With non-primitives, if you assign another variable to a piece of data, the first
variable will no longer hold that value. You'll need to use a reference (&) to
point to the resource...

Structs

Structs - used to create custom data types

Enums

Enums are types which have a few definite values

Command Line Args

See the file "cli.rs"


About

Learning Rust

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published