- 22
- 34 122
cudidotdev
Nigeria
เข้าร่วมเมื่อ 27 พ.ย. 2023
Working on it
How to Mock Unit Tests in Rust with the MockAll Crate
Learn how to mock external dependencies in your unit tests with the Mockall crate in Rust! This comprehensive guide covers:
What is Mocking & Why You Need It
Manual Mocking Implementation
Mockall Setup & Basics
Creating mock objects with Mockall
Advanced matching techniques
Controlling method call counts
Optimizing binary size for production
Working with non-cloneable types
Perfect for Rust developers who want to write more reliable and maintainable tests. Includes practical examples and performance optimization tips.
💻 Get the code: github.com/cudidotdev/rust-mocks
📚 Mockall docs: docs.rs/mockall/0.13.1/mockall/index.html
#RustLang #Programming #Testing #UnitTesting #RustProgramming #SoftwareDevelopment
⏱️ Timestamps:
00:00 Introduction
01:32 Manual Mock
03:34 MockAll
05:35 Matchers
07:40 Call Counts
10:22 Bonus (return methods, optimizing program size)
#RustLang #Programming #Mocking #CodingTutorial #MockAll #RustProgramming #SoftwareDevelopment
What is Mocking & Why You Need It
Manual Mocking Implementation
Mockall Setup & Basics
Creating mock objects with Mockall
Advanced matching techniques
Controlling method call counts
Optimizing binary size for production
Working with non-cloneable types
Perfect for Rust developers who want to write more reliable and maintainable tests. Includes practical examples and performance optimization tips.
💻 Get the code: github.com/cudidotdev/rust-mocks
📚 Mockall docs: docs.rs/mockall/0.13.1/mockall/index.html
#RustLang #Programming #Testing #UnitTesting #RustProgramming #SoftwareDevelopment
⏱️ Timestamps:
00:00 Introduction
01:32 Manual Mock
03:34 MockAll
05:35 Matchers
07:40 Call Counts
10:22 Bonus (return methods, optimizing program size)
#RustLang #Programming #Mocking #CodingTutorial #MockAll #RustProgramming #SoftwareDevelopment
มุมมอง: 98
วีดีโอ
How to Test Asynchronous Rust Programs with Tokio [TUTORIAL]
มุมมอง 66914 ชั่วโมงที่ผ่านมา
Learn how to test your asynchronous and multi-threaded programs in Rust using the Tokio runtime! This comprehensive tutorial covers: - The tokio test attribute - Using tokio test macros - Tokio assertion macros (assert_pending macro, assert_ready macro, assert_ready_ok macro, assert_ready_err, assert_ready_eq macro) - Testing timeouts / intervals efficiently Chapters: 00:00 The Problem 01:03 Th...
Testing your Rust Program | A Complete & Practical Guide
มุมมอง 50514 วันที่ผ่านมา
Learn everything from basic unit and integration tests, all test attributes and cli commands to calculating the test coverage in your program, perfect for both beginners and experienced Rust developers. In this tutorial, you'll learn: How to write and organize unit tests in Rust Setting up integration tests properly Calculating and improving test coverage Using test attributes effectively Filte...
Simplify your Rust Configurations with the Config Crate
มุมมอง 534หลายเดือนก่อน
Learn how to simplify configuration management in Rust using the config crate. This tutorial shows you how to easily handle environment variables and configuration files (JSON, TOML, YAML) in your Rust applications with minimal boilerplate code. In this video, you'll learn: - How to use the config crate with environment variables - Creating configurations from TOML, JSON, and YAML files - Worki...
Handling Environment Variables in a Rust Program
มุมมอง 6112 หลายเดือนก่อน
Learn how to properly handle environment variables in your Rust applications! This comprehensive tutorial takes you from basic command-line environment variables to implementing a robust configuration system using .env files and the powerful lazy_static pattern. ⏱️ Timeline: 00:00 Purpose of the video 04:43 Setting Environment Variables via Command Line 05:27 Accessing Environment Variables in ...
Full Rust Programming Course for Beginners and Building an Unbeatable Tic-Tac-Toe Game Step-by-Step
มุมมอง 3.7K2 หลายเดือนก่อน
In this video, you will learn the basics of Rust and build an unbeatable tic-tac-toe CLI game. 👉 If this is the best Rust tutorial you’ve seen, you can support me at buymeacoffee.com/cudidotdev. Github Repo: github.com/cudidotdev/rust-tictactoe-cli Timestamps 00:00 Introduction 02:32 Installing Rust and Setting up Your Development Environment 06:49 The Structure of a Rust Program 12:03 Printing...
Lifetimes in Rust Explained with Examples
มุมมอง 7144 หลายเดือนก่อน
Learn how Rust uses lifetimes to prevent dangling references and ensure safe borrowing through examples. We cover: Understanding variable scopes and lifetime concepts Analyzing lifetime issues in functions and structs Explicit lifetime annotations and their syntax Returning references from functions safely Managing multiple lifetimes in function parameters The 'static lifetime and its use cases...
Borrowing and References in Rust Explained
มุมมอง 4194 หลายเดือนก่อน
This insightful video provides a comprehensive overview of references and borrowing in Rust. It discusses the borrowing rules, mutable and immutable references, and offers a concise introduction to lifetimes in Rust. Futher reading: cudi.dev/articles/borrowing_and_references_in_rust_explained Timestamp: 00:00 Recap on the Ownership System in Rust 01:26 Borrowing and References in Rust 03:02 Typ...
Ownership in Rust Explained
มุมมอง 4364 หลายเดือนก่อน
This explains the ownership system in Rust very simply and comprehensively. It begins by explaining the allocation and deallocation from the stack and heap, which provides a foundation for understanding the ownership system. Further Reading: cudi.dev/articles/ownership_in_rust_explained Timestamps 00:00 The stack and the heap 02:40 The rust ownership model 05:30 References and Borrowing (Introd...
Number Types in Rust Explained
มุมมอง 1254 หลายเดือนก่อน
This video talks about the different rust number types, signed and unsigned integers, integer literal representation, integer overflow, floats, and the byte number literal. Further reading: cudi.dev/articles/rust_number_types_explained Timestamps 00:00 Introduction 00:30 Signed and Unsigned Integers 02:45 Representing integer literals in Rust 03:36 Integer Overflow in Rust 05:35 Floats 06:45 By...
How to create an AWS S3 File Upload Service in Rust Axum
มุมมอง 7037 หลายเดือนก่อน
How to create an AWS S3 File Upload Service in Rust Axum
Rust for Web Assembly | Setup + Tutorial Guide
มุมมอง 2.4K7 หลายเดือนก่อน
Rust for Web Assembly | Setup Tutorial Guide
Learn about Rust RC Smart Pointer by Creating a Linked List Data Structure
มุมมอง 1.7K8 หลายเดือนก่อน
Learn about Rust RC Smart Pointer by Creating a Linked List Data Structure
JWT Authentication in Rust [Full Guide : Axum & Actix]
มุมมอง 5K9 หลายเดือนก่อน
JWT Authentication in Rust [Full Guide : Axum & Actix]
Build a CRUD REST API with Rust Axum | Tutorial
มุมมอง 13K10 หลายเดือนก่อน
Build a CRUD REST API with Rust Axum | Tutorial
POSTGRESQL JOINS [Complete guide in 12 mins]
มุมมอง 1.8Kปีที่แล้ว
POSTGRESQL JOINS [Complete guide in 12 mins]
good explanation
Thanks!
Go man! Thanks
Thanks gee!
Useful tips and resources 👇 📚 The Mockall docs 👉 docs.rs/mockall/0.13.1/mockall/index.html 💻 Here's the Code to follow through this video 👉 github.com/cudidotdev/rust-mocks This video contains a lot of information you will find very useful. Please watch to the end and like for the algorithm 🙏
your neovim looks so polished, do you have it on github?
I'm not really sure, but i used nvchad for my setup
@cudidotdev oh ok will check it out
This is an great video, thank you!
I'm glad you found it helpful 👍
The start_paused was a really neat trick I would have likeky not found out about. Thanks
You are welcome!
What a great consise video. Thanks I love this.
I'm glad you loved it!
Excellent video. I wanted to clarify one thing on your analogy between JS promises and Rust futures. One key difference here is that a Rust future will never execute anything until you await it. Whereas a JS promise will begin execution when it’s initialized. In other words, Rust futures are lazy and JS promises are eager.
Yes! You are right. I didn't want to go deep on futures since I assume the viewer may already know about it. If they didn't, comparing it to promises in JS is enough to give them an idea of what it is.
This was good, mate. Thanks.
Thank you too ‼️
Here's the link to the repository for the codebase: github.com/cudidotdev/async-tests
Very nice presentation!
Good content you remind me of lesteachersdunet style of teaching. please keep releasing new rust content I have subscribed.
Awesome video thanks a lot
You are welcome, thanks!
Impeccably conceptualized and narrated: this video has a lot of depth while also being precise and succinct.
The patterns you show are very valuable
So nice of you, Glad you liked it
Amazing. Thanks
Helpful video!
I'm glad you found it useful
I 've been using Rust about 3 years,, this is the Best complete course that anybody can find on TH-cam and very well explained i,,, keep doing that way, You are doing great, congratulations
Thanks a lot, Juan. I really appreciate this
such a nice rust tutorial!
Thank you! Cheers!
Awesome 👍👌
You are great teaching Rust. Please continue to release videos about Rust building more projects as for example backend etc. Cheers!
I will surely do ! I am releasing general guides on rust programming for now as a precursor to project building videos. Luckily, by the end of the year I may release a tutorial on asynchronous programming in Rust. Then, advanced backend development will follow.
👉 Next Video on Simplifying your Rust Configurations with the Config Crate: th-cam.com/video/BSB4lcQxubE/w-d-xo.html
👉 Previous video on Using Environment Variables in Rust: th-cam.com/video/J3jG4m6GH0c/w-d-xo.html Thanks for watching !! - Please share :)
i wanna learn more in depth how "extern C" declarations work to connect to javascript. i've read the documentation for wasm-pack first but i still couldn't take a grasp of it yet to understand the whole thing. thank you for the video though.
Thats a good question! It is used for cross-language interoperability. When a language depends on a resource from another language, it uses the C calling convetion as it is the most popular and widely supported. The extern C declaration indicates that a function should use the C calling convetion instead of Rust. This allows it to be called from a javascript program.
@@cudidotdev oh thank you, that makes much more sense now ^^ i'll look into it more later on, and i'll keep that in mind <3
Tanks so much ❤
You're welcome !!
Great bro ❤❤❤❤❤❤❤❤
Excellent bro, but the way you import and install make us think that we have to memorize it all 😢.
Sorry for that, I plan to make a crash course on axum and actix and every step will be explained in detail there
I kid you not I have been searching for this exact tutorial for so damn long, You are an absolute God send. And also, Jesus loves you.
Thanks, I'm glad you found it helpful 👍
Thank you so much for teaching rust programing ❤
You're welcome
Great explanation! The volume is quite low and it makes it seem like you are whispering. Welldone!
Sorry about that
Does this also work with the rust-s3 crate?
You can use it with axum but I will recommend the official aws-sdk-s3 crate from the AWS team
#[wasm_bindgen] is an attribute not a macro? Anyway, I need something like this to test if radiology 3d render can be bbuilt for such kinda data
It's an attribute macro. They are different kinds of macros in rust - Attribute macros - Derive macros - Function-Like macros
Just amazing your work
can you do a video for just multipart ?
I am creating an in-depth video on Actix Web and another for Axum. It is included in a section for both
Wow i love your explanations and presentation
Thank you ✨
would be great to see in future video about more complex rust types
cool rust content, please keep going
A 2 hour practical series on rust for beginners will soon be out ✨
Why are you whispering dude? Borrowing and references are not that big of secrets.
Sorry 😂, I had to record and I was sick at the time
@@cudidotdev get well soon!
Sounds interesting, but as a non-English speaker I have a hard time understanding the accent.
Sorry about that, you can use auto generated subtitles
@@cudidotdev Thank you, good advice!
Thanks a lot! That was useful.
Go man!
One of the best tutorial I have seen so far. Keep it coming . 🙂Very helpful. Our whole dev team from Madagascar
Helpful video as always
Glad it was helpful!
Thanks! Love you NeoVim Rust setup. Tried to switch to NeoVim from VSCode and failed a couple of times now. Kept struggling with making things work. Haha
You can check out one of the recent videos from mental outlaw, but you would need to have nvchad installed. You can find nvchad installation somewhere on YT
Beautiful tutorial... how did you get those pretty checkmarks in your lines of code?
You help us a lot! Please make a video on your nvim setup!
More rust tutorial pls
Thank you for this great video. I want to practice this but github link is not working. Can you help me?
You're welcome. Here's the updated link gist.github.com/cudidotdev/2a76de8b5c528c98ab911b6eda981e79
Nice content chief
Thanks. This keeps me motivated 🩶
oh thank you so much best tutorial i found on youtube for joins
You're welcome!
I really appreciate your channel. Can I ask you for a crud with Rust and axum also writing the tests?
Alright 👍