cudidotdev
cudidotdev
  • Видео 22
  • Просмотров 35 276
Why and How to Mock Unit Tests in Rust || 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 #SoftwareDevelop...
Просмотров: 164

Видео

How to Test Asynchronous Rust Programs with Tokio [TUTORIAL]
Просмотров 719День назад
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
Просмотров 51914 дней назад
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
Просмотров 5482 месяца назад
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
Просмотров 6222 месяца назад
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
Просмотров 4,3 тыс.2 месяца назад
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
Просмотров 7464 месяца назад
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
Просмотров 4324 месяца назад
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
Просмотров 4384 месяца назад
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
Просмотров 1274 месяца назад
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
Просмотров 7107 месяцев назад
How to create an AWS S3 File Upload Service in Rust Axum
Rust for Web Assembly | Setup + Tutorial Guide
Просмотров 2,4 тыс.7 месяцев назад
Rust for Web Assembly | Setup Tutorial Guide
Learn about Rust RC Smart Pointer by Creating a Linked List Data Structure
Просмотров 1,7 тыс.8 месяцев назад
Learn about Rust RC Smart Pointer by Creating a Linked List Data Structure
JWT Authentication in Rust [Full Guide : Axum & Actix]
Просмотров 5 тыс.10 месяцев назад
JWT Authentication in Rust [Full Guide : Axum & Actix]
Build a CRUD REST API with Rust Axum | Tutorial
Просмотров 13 тыс.11 месяцев назад
Build a CRUD REST API with Rust Axum | Tutorial
PostgreSQL Upsert
Просмотров 22211 месяцев назад
PostgreSQL Upsert
POSTGRESQL JOINS [Complete guide in 12 mins]
Просмотров 1,9 тыс.Год назад
POSTGRESQL JOINS [Complete guide in 12 mins]

Комментарии

  • @Shidane_yare
    @Shidane_yare 2 дня назад

    Thanks bud 🫡

  • @nithingowda1060
    @nithingowda1060 4 дня назад

    good explanation

  • @meka4996
    @meka4996 6 дней назад

    Go man! Thanks

  • @cudidotdev
    @cudidotdev 6 дней назад

    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 🙏

  • @giorgos-4515
    @giorgos-4515 8 дней назад

    your neovim looks so polished, do you have it on github?

    • @cudidotdev
      @cudidotdev 8 дней назад

      I'm not really sure, but i used nvchad for my setup

    • @giorgos-4515
      @giorgos-4515 8 дней назад

      @cudidotdev oh ok will check it out

  • @12px
    @12px 8 дней назад

    This is an great video, thank you!

    • @cudidotdev
      @cudidotdev 8 дней назад

      I'm glad you found it helpful 👍

  • @antoniong4380
    @antoniong4380 8 дней назад

    The start_paused was a really neat trick I would have likeky not found out about. Thanks

  • @thefluentone
    @thefluentone 8 дней назад

    What a great consise video. Thanks I love this.

    • @cudidotdev
      @cudidotdev 8 дней назад

      I'm glad you loved it!

  • @jjferman2587
    @jjferman2587 9 дней назад

    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.

    • @cudidotdev
      @cudidotdev 9 дней назад

      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.

  • @FranciscoRuizA
    @FranciscoRuizA 9 дней назад

    This was good, mate. Thanks.

  • @cudidotdev
    @cudidotdev 10 дней назад

    Here's the link to the repository for the codebase: github.com/cudidotdev/async-tests

  • @saenttor
    @saenttor 26 дней назад

    Very nice presentation!

  • @wassim-akkari
    @wassim-akkari 28 дней назад

    Good content you remind me of lesteachersdunet style of teaching. please keep releasing new rust content I have subscribed.

  • @RizkiTaufikAnindhita
    @RizkiTaufikAnindhita Месяц назад

    Awesome video thanks a lot

    • @cudidotdev
      @cudidotdev Месяц назад

      You are welcome, thanks!

  • @aaronocelot
    @aaronocelot Месяц назад

    Impeccably conceptualized and narrated: this video has a lot of depth while also being precise and succinct.

    • @aaronocelot
      @aaronocelot Месяц назад

      The patterns you show are very valuable

    • @cudidotdev
      @cudidotdev Месяц назад

      So nice of you, Glad you liked it

  • @meka4996
    @meka4996 Месяц назад

    Amazing. Thanks

  • @keizbot
    @keizbot Месяц назад

    Helpful video!

    • @cudidotdev
      @cudidotdev Месяц назад

      I'm glad you found it useful

  • @JuanLauchoWalkthrough
    @JuanLauchoWalkthrough Месяц назад

    I 've been using Rust about 3 years,, this is the Best complete course that anybody can find on RUclips and very well explained i,,, keep doing that way, You are doing great, congratulations

    • @cudidotdev
      @cudidotdev Месяц назад

      Thanks a lot, Juan. I really appreciate this

  • @bruceandre7455
    @bruceandre7455 Месяц назад

    such a nice rust tutorial!

  • @xsdash
    @xsdash Месяц назад

    Awesome 👍👌

  • @ei5586
    @ei5586 2 месяца назад

    You are great teaching Rust. Please continue to release videos about Rust building more projects as for example backend etc. Cheers!

    • @cudidotdev
      @cudidotdev 2 месяца назад

      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.

  • @cudidotdev
    @cudidotdev 2 месяца назад

    👉 Next Video on Simplifying your Rust Configurations with the Config Crate: ruclips.net/video/BSB4lcQxubE/видео.html

  • @cudidotdev
    @cudidotdev 2 месяца назад

    👉 Previous video on Using Environment Variables in Rust: ruclips.net/video/J3jG4m6GH0c/видео.html Thanks for watching !! - Please share :)

  • @Wilker_uwu
    @Wilker_uwu 2 месяца назад

    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.

    • @cudidotdev
      @cudidotdev 2 месяца назад

      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.

    • @Wilker_uwu
      @Wilker_uwu 2 месяца назад

      @@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

  • @silq300
    @silq300 2 месяца назад

    Tanks so much ❤

    • @cudidotdev
      @cudidotdev 2 месяца назад

      You're welcome !!

  • @azharalibhutto1209
    @azharalibhutto1209 2 месяца назад

    Great bro ❤❤❤❤❤❤❤❤

  • @arabeyabelajarnahwu-shorof5902
    @arabeyabelajarnahwu-shorof5902 2 месяца назад

    Excellent bro, but the way you import and install make us think that we have to memorize it all 😢.

    • @cudidotdev
      @cudidotdev 2 месяца назад

      Sorry for that, I plan to make a crash course on axum and actix and every step will be explained in detail there

  • @BenElyonMolgeri
    @BenElyonMolgeri 2 месяца назад

    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.

    • @cudidotdev
      @cudidotdev 2 месяца назад

      Thanks, I'm glad you found it helpful 👍

  • @azharalibhutto1209
    @azharalibhutto1209 2 месяца назад

    Thank you so much for teaching rust programing ❤

  • @adetunjiojekunle1502
    @adetunjiojekunle1502 2 месяца назад

    Great explanation! The volume is quite low and it makes it seem like you are whispering. Welldone!

  • @Sword_of_Rupture
    @Sword_of_Rupture 3 месяца назад

    Does this also work with the rust-s3 crate?

    • @cudidotdev
      @cudidotdev 2 месяца назад

      You can use it with axum but I will recommend the official aws-sdk-s3 crate from the AWS team

  • @codeaperture
    @codeaperture 3 месяца назад

    #[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

    • @cudidotdev
      @cudidotdev 3 месяца назад

      It's an attribute macro. They are different kinds of macros in rust - Attribute macros - Derive macros - Function-Like macros

  • @ChristianYemele
    @ChristianYemele 4 месяца назад

    Just amazing your work

  • @ChristianYemele
    @ChristianYemele 4 месяца назад

    can you do a video for just multipart ?

    • @cudidotdev
      @cudidotdev 4 месяца назад

      I am creating an in-depth video on Actix Web and another for Axum. It is included in a section for both

  • @ChristianYemele
    @ChristianYemele 4 месяца назад

    Wow i love your explanations and presentation

  • @VladSaratovskyi
    @VladSaratovskyi 4 месяца назад

    would be great to see in future video about more complex rust types

  • @VladSaratovskyi
    @VladSaratovskyi 4 месяца назад

    cool rust content, please keep going

    • @cudidotdev
      @cudidotdev 4 месяца назад

      A 2 hour practical series on rust for beginners will soon be out ✨

  • @rVnikov
    @rVnikov 4 месяца назад

    Why are you whispering dude? Borrowing and references are not that big of secrets.

    • @cudidotdev
      @cudidotdev 4 месяца назад

      Sorry 😂, I had to record and I was sick at the time

    • @rVnikov
      @rVnikov 4 месяца назад

      @@cudidotdev get well soon!

  • @magnusmarkling
    @magnusmarkling 4 месяца назад

    Sounds interesting, but as a non-English speaker I have a hard time understanding the accent.

    • @cudidotdev
      @cudidotdev 4 месяца назад

      Sorry about that, you can use auto generated subtitles

    • @magnusmarkling
      @magnusmarkling 4 месяца назад

      @@cudidotdev Thank you, good advice!

  • @torrvic1156
    @torrvic1156 4 месяца назад

    Thanks a lot! That was useful.

  • @meka4996
    @meka4996 4 месяца назад

    Go man!

  • @lerinarazafy7826
    @lerinarazafy7826 4 месяца назад

    One of the best tutorial I have seen so far. Keep it coming . 🙂Very helpful. Our whole dev team from Madagascar

  • @codewithpraisejames
    @codewithpraisejames 4 месяца назад

    Helpful video as always

    • @cudidotdev
      @cudidotdev 4 месяца назад

      Glad it was helpful!

  • @ahalsudev
    @ahalsudev 5 месяцев назад

    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

    • @cudidotdev
      @cudidotdev 4 месяца назад

      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

  • @Shemang
    @Shemang 5 месяцев назад

    Beautiful tutorial... how did you get those pretty checkmarks in your lines of code?

  • @alexanderleschanz9991
    @alexanderleschanz9991 6 месяцев назад

    You help us a lot! Please make a video on your nvim setup!

  • @victorgxn
    @victorgxn 6 месяцев назад

    More rust tutorial pls

  • @harshafarenjiya
    @harshafarenjiya 6 месяцев назад

    Thank you for this great video. I want to practice this but github link is not working. Can you help me?

    • @cudidotdev
      @cudidotdev 6 месяцев назад

      You're welcome. Here's the updated link gist.github.com/cudidotdev/2a76de8b5c528c98ab911b6eda981e79

  • @xosnrdev
    @xosnrdev 6 месяцев назад

    Nice content chief

    • @cudidotdev
      @cudidotdev 6 месяцев назад

      Thanks. This keeps me motivated 🩶

  • @animix_4
    @animix_4 7 месяцев назад

    oh thank you so much best tutorial i found on youtube for joins

    • @cudidotdev
      @cudidotdev 7 месяцев назад

      You're welcome!