Deva Krishna S J (@sdeva31156) 's Twitter Profile
Deva Krishna S J

@sdeva31156

FullStack + DSA +Web3

ID: 1838712932420718596

linkhttps://www.linkedin.com/in/deva-krishna-s-j-5a2508277 calendar_today24-09-2024 22:51:58

88 Tweet

125 Takipçi

783 Takip Edilen

Deva Krishna S J (@sdeva31156) 's Twitter Profile Photo

🦀 Rust 101 – Lesson 13 • Use &var to borrow without moving ownership • Function receives a reference, not the value • Borrowed data can still be used after the call

🦀 Rust 101 – Lesson 13
• Use &var to borrow without moving ownership
• Function receives a reference, not the value
• Borrowed data can still be used after the call
Deva Krishna S J (@sdeva31156) 's Twitter Profile Photo

🦀 Rust 101 – Lesson 14 -Borrowship rules -1 • ✅ Multiple immutable refs allowed • ❌ Only one mutable ref at a time • ❌ No mix of mutable & immutable at once • Prevents data races at compile time

🦀 Rust 101 – Lesson 14 -Borrowship rules -1
• ✅ Multiple immutable refs allowed
• ❌ Only one mutable ref at a time
• ❌ No mix of mutable & immutable at once
• Prevents data races at compile time
Deva Krishna S J (@sdeva31156) 's Twitter Profile Photo

🦀 Rust 101 – Lesson 15 • Mutable refs must be unique, but scope matters • After str1 is used, its borrow ends • Then str2 (an immutable ref) is allowed • Rust enforces borrow rules within overlapping scopes, not just lines • Compiler sees str1 is done before str2 starts

🦀 Rust 101 – Lesson 15 
• Mutable refs must be unique, but scope matters
• After str1 is used, its borrow ends
• Then str2 (an immutable ref) is allowed
• Rust enforces borrow rules within overlapping scopes, not just lines
• Compiler sees str1 is done before str2 starts
Deva Krishna S J (@sdeva31156) 's Twitter Profile Photo

🦀 Rust 101 – Lesson 16 • struct = custom data type with named fields • Define once, reuse everywhere • Fields can have different types • Access with . (e.g. p1.name)

🦀 Rust 101 – Lesson 16
• struct = custom data type with named fields
• Define once, reuse everywhere
• Fields can have different types
• Access with . (e.g. p1.name)
Deva Krishna S J (@sdeva31156) 's Twitter Profile Photo

🦀 Rust 101 – Lesson 17 • Use impl to define methods for a struct • &self = borrow the instance (like this in other langs) • Call with instance.method() • No self = associated (static) function → call with Type::function() • Keep logic organized with methods!

🦀 Rust 101 – Lesson 17 
• Use impl to define methods for a struct 
• &self = borrow the instance (like this in other langs)
 • Call with instance.method() 
• No self = associated (static) function → call with Type::function() 
• Keep logic organized with methods!
Deva Krishna S J (@sdeva31156) 's Twitter Profile Photo

🦀 Rust 101 – Lesson 18 • enum = define a type with fixed possible values • Each variant is like a named option: North, South... • Use with :: → Direction::North • Can pattern match or pass as function args • Add #[derive(Debug)](consider as a black box) to print them!

🦀 Rust 101 – Lesson 18
• enum = define a type with fixed possible values
• Each variant is like a named option: North, South...
• Use with :: → Direction::North
• Can pattern match or pass as function args
• Add #[derive(Debug)](consider as a black box)  to print them!
Deva Krishna S J (@sdeva31156) 's Twitter Profile Photo

🦀 Rust 101 – Lesson 19 • match lets you branch by enum variant • Like switch, but exhaustive and safer • Use => to handle each case • _ matches anything not explicitly handled • Encourages handling all possibilities

🦀 Rust 101 – Lesson 19
• match lets you branch by enum variant
• Like switch, but exhaustive and safer
• Use => to handle each case
• _ matches anything not explicitly handled
• Encourages handling all possibilities
Deva Krishna S J (@sdeva31156) 's Twitter Profile Photo

🦀 Rust 101 – Lesson 20 - inbuild enums • Option enum = Some(val) or None → handles "maybe" • Result enum = Ok(val) or Err(err) → handles errors • Use match to handle them safely • No nulls, no exceptions — just safe patterns

🦀 Rust 101 – Lesson 20 - inbuild enums
• Option enum = Some(val) or None → handles "maybe"
• Result enum = Ok(val) or Err(err) → handles errors
• Use match  to handle them safely
• No nulls, no exceptions — just safe patterns
Deva Krishna S J (@sdeva31156) 's Twitter Profile Photo

🦀 Rust 101 – Lesson 21 – Crates & Dependencies • Crates = Rust's packages/modules • Use cargo new to start a new crate • Add dependencies in Cargo.toml • Use use crate_name::item to import • Crates.io = Rust’s package registry

🦀 Rust 101 – Lesson 21 – Crates & Dependencies
• Crates = Rust's packages/modules
• Use cargo new to start a new crate
• Add dependencies in Cargo.toml
• Use use crate_name::item to import
• Crates.io = Rust’s package registry
Deva Krishna S J (@sdeva31156) 's Twitter Profile Photo

🦀 Rust 101 – Lesson 22 – Generics+Trait Bounds • Generics let functions work with any type: fn print_value<T>(val: T) • But Rust needs to know what T can do • Trait bounds restrict T to types that implement certain behavior •T: Display = only accept types that can be printed

🦀 Rust 101 – Lesson 22 – Generics+Trait Bounds
• Generics let functions work with any type: fn print_value&lt;T&gt;(val: T)
• But Rust needs to know what T can do
• Trait bounds restrict T to types that implement certain behavior
•T: Display = only accept types that can be printed
Deva Krishna S J (@sdeva31156) 's Twitter Profile Photo

🦀 Rust 101 – Lesson 23 – Traits • Traits define shared behavior across types • Like interfaces in other languages • Define with trait TraitName {} • Implement using impl TraitName for Type {}

🦀 Rust 101 – Lesson 23 – Traits
• Traits define shared behavior across types
• Like interfaces in other languages
• Define with trait TraitName {}
• Implement using impl TraitName for Type {}
Deva Krishna S J (@sdeva31156) 's Twitter Profile Photo

🦀 Rust 101 – Lesson 24 – Macros • Macros = code that writes code 💥 • Use ! to call: println!, vec!, etc. • Built-in: println!, format!, dbg!, vec!

🦀 Rust 101 – Lesson 24 – Macros
• Macros = code that writes code 💥
• Use ! to call: println!, vec!, etc.
• Built-in: println!, format!, dbg!, vec!
Deva Krishna S J (@sdeva31156) 's Twitter Profile Photo

🦀 Rust 101 – Lesson 25 – Copy vs Clone • In Rust, assigning moves ownership by default • Add #[derive(Copy, Clone)] to make a type cheap to copy • Copy = duplicates automatically (stack types like integers, bools, small structs) • Use when your type has no heap data (String)

🦀 Rust 101 – Lesson 25 – Copy vs Clone
• In Rust, assigning moves ownership by default
• Add #[derive(Copy, Clone)] to make a type cheap to copy
• Copy = duplicates automatically (stack types like integers, bools, small structs)
• Use when your type has no heap data (String)
Deva Krishna S J (@sdeva31156) 's Twitter Profile Photo

🗳️ Just built a decentralized voting app on Solana! On-chain voting with Anchor ⚡ Blink integration for seamless UX Open-sourced here 👉 github.com/Deva-2002/dece…

Deva Krishna S J (@sdeva31156) 's Twitter Profile Photo

I’ve been learning Rust recently and kept notes + examples along the way. Turned it into a repo If you’re curious about Rust basics maybe this helps: 👉 github.com/Deva-2002/rust…

Deva Krishna S J (@sdeva31156) 's Twitter Profile Photo

Just built a simple 🌉 EVM Bridge Contract! Deploys 2 custom ERC-20 tokens Bridge lets you lock on Chain A & mint on Chain B Wrote tests in TypeScript to validate the flow 🚀 Code here 👉 [github.com/Deva-2002/Eth-…]

Deva Krishna S J (@sdeva31156) 's Twitter Profile Photo

Built a vesting app on Solana 🌱 It lets companies create token vesting schedules for their teams (with start, cliff, and end times). -> [github.com/Deva-2002/vest…]

Deva Krishna S J (@sdeva31156) 's Twitter Profile Photo

⚡ Building WebCraft – an AI-powered website builder (WIP) Think “describe your dream site → get a step-by-step plan” 💡 Tech: React + Node.js + WebContainers (Claude-like architecture) Still early, but hacking on it here 👇 🔗 github.com/Deva-2002/WebC…

Deva Krishna S J (@sdeva31156) 's Twitter Profile Photo

I just tracked all my job applications using JobTrackr — staying organized and motivated! 🚀 preview--jobtrackr-flow.lovable.app