📝 Get your *FREE Rust cheat sheet* : www.letsgetrusty.com/cheatsheet
@koustubh74762 жыл бұрын
Your explanation is really easy to understand, thank you!
@k3rnel_err0r3 жыл бұрын
I recently discovered your channel I like it so far. I'm big fan of Rust, I cannot say I'm still good at it though. Keep up the good work.
@zes72152 жыл бұрын
no such thing as want or duplication or concise or short or etc, outx, can outx infix any nmw and any s perfect
@jaredrethman3 жыл бұрын
Love your content. The whole way through this video I was certain there would be a performance hit i.e. type coercion (sorry PHP and JS dev here) Then you mentioned it is taken care of! Loving this - thank you so much!
@31redorange083 жыл бұрын
The obvious drawback is that for each concrete type the compiler generates "duplicate" code, leading to a bigger executable.
@SemiMono2 жыл бұрын
Yep. Compiling multiple versions is standard for generics in compiled languages. In C++ though, it's a pain in the *** to use generics declared in a separate binary that's linked dynamically. I suppose, dynamic linking is a pain in the *** regardless. I'm brand new to rust so I don't know how it handles it yet (does it?)
@lacascadaobregon2 жыл бұрын
@@SemiMono It's a pain in the pointer, and a pain in the dereference.
@TheEmbeddedLinuxDude3 жыл бұрын
This was very well explained. Thank you Bogdan!
@comicalleel471017 сағат бұрын
Great explaination finally understood how generics work
@tombo6152 жыл бұрын
This was a super helpful overview - great job!
@Kollegah99972 жыл бұрын
as a C# Developer this looks just like im using it in C#, Rust is really awesome
@adrian_sp6def Жыл бұрын
question: 11:18, why fn mixup can not have &self argument? it fails due to T does not implemnt Copy Trait, but why this missing Copy Trait works with self as not a reference? I though that T has no Copy Trait no matter self is a reference or not.
@bjugdbjk3 жыл бұрын
Fabulous Man !!! I was going through the rust book for quite some time, but the topics I was able to cover using ur playlist is far more in great pace !!! tysm , just love ur teaching style !! Can see lot of traction of using rust in blockchain, could you make something building common concepts in blokchain using RUST, I guess this will bring lot of traction to ur channel too :)
@Taetae_17172 жыл бұрын
How do you cast generic type to primitive? Example minutes 09:41, line 8, &self.x + 1
@NFLStudy2 жыл бұрын
Excellent video on a topic that can be difficult for some.
@devOnHoliday8 ай бұрын
7:17 For Structs, why do we have to define Types T and U if both are used to take any type, and why not just let it be i32 and f32
@teachforyou64893 жыл бұрын
Thank YOu Bogdan You are really doing superb.
@sahilverma40773 жыл бұрын
I really think traits are a really good way to limit your template and make them safer, wish we had those in java too (we have something similar but not close, i.e., we can extend from prebuilt classes so that the T type can be only of a child type of only a particular class)
@31redorange083 жыл бұрын
Not sure what exactly you are missing in Java.
@sahilverma40773 жыл бұрын
@@31redorange08 I don't know if there is a way to limit a genric class's method to only work with a particular class
@31redorange083 жыл бұрын
@@sahilverma4077 Don't make it generic then.
@sahilverma40773 жыл бұрын
@@31redorange08 have you ever noticed we can have a stream of any class but not of characters
@sahilverma40773 жыл бұрын
I want that kind of feature
@tech34254 ай бұрын
10:51 That is so cool
@redcrafterlppa3032 жыл бұрын
You mentioned that the all needed versions of a generic are created at compile time. So are generics implemented using type erasure like in java or how does it work under the hood?
@maksymrachytskyy16772 жыл бұрын
Looks pretty much like swift ) thank you for your tuts
@oyewodayo2 жыл бұрын
Same person created both Swift and Rust.
@kmaximoff7 ай бұрын
YES! I love Swift that is why I fall in love with Rust.
@dzibanart85213 жыл бұрын
yoooo nicely explained! subscribed
@letsgetrusty3 жыл бұрын
Welcome aboard!
@GolangDojo3 жыл бұрын
What are you doing with your audio? Sounds so clean
@letsgetrusty3 жыл бұрын
Nothing special, just using the Blue Yeti mic!
@ozanmuyes3 жыл бұрын
Two eggs in the morning and a glass of whiskey at night 😉
@oyewodayo2 жыл бұрын
@@ozanmuyes Does this really works or just sarcasm?
@filipbarbaric19602 жыл бұрын
men you are better than undemy tutorials.
@rotteegher39 Жыл бұрын
Do you have an Option and Result enums as a tattoos on your arms?
@cleverengineer24108 ай бұрын
this channel as become a school for me
@JohnWick-mk4ve3 жыл бұрын
Hi.. great video.. thanks !
@exoticcoder53653 жыл бұрын
I just learnt that John Wick is a programmer
@lsatenstein2 жыл бұрын
I have started learning RUST and your videos help me immensely. I follow your explanations and those as well from the PDF files on my desktop. Here is one question for you about structures. In C, I can define a structure as a typedef. Is the typedef facility or prototyping function definitions also available in Rust?
@Gramini2 жыл бұрын
If I understand typedef correctly, it'S a type alias. Those exist in Rust as well by using the type keyword: type TypeAlias = MyStruct;
@hanyanglee90188 ай бұрын
c++ added similar feature in c++20. Basically, this feature is introduced to programming after 2015. People waited for it for at least 20 years.
@tech34254 ай бұрын
Loved it
@WaiTingKuo05272 жыл бұрын
why doesnt my refactoring menu show the "extract function" method? any extension i need to install except rust-analyzer?
@გიორგი-ნ1ძ2 жыл бұрын
rust-cocnballz It's really helpful extension
@natanfurman24672 жыл бұрын
Why doesn’t the last example throw an error at line 21, arent x and y private?
@walli33 Жыл бұрын
Nice Morgan !!!
@sc5shout3 жыл бұрын
Is there a variadic generic type?
@HermanWillems3 жыл бұрын
:( i think not yet i hope it will be soon.
@raffimolero642 жыл бұрын
would be really cool, but not yet :( right now the way rust handles variadic arguments for functions is not to write a function but a macro instead. macros are able to match a variable number of arguments and often expand recursively. you *could* write a macro that creates something based on a variable number of types, but you'd lose the things that make normal generics good: when you use a normal generic, a new type is automatically inferred and created.
@nirajgautam40310 ай бұрын
Can anyone share some reference for inheritance like functionality in rust
@IvanMorozov-f6w9 ай бұрын
очень полезные видео, спасибо
@paperstars9078 Жыл бұрын
what is the music in the background?
@jabuci2 жыл бұрын
At mixup(), I want the first parameter to be &self, not just self. p1.mixup(p2) consumes both p1 and p2 because of move :(
@orhalimi3 жыл бұрын
Great video
@feliperios75362 жыл бұрын
Nice job
@coldsir54062 жыл бұрын
Why do we need to define the type of impl can't we just write witrhout generics like ```impl Point```
@raffimolero642 жыл бұрын
impl Point means "for every point whose x is any type and y is any type" impl Point would mean "for every point whose x and y are the same type" impl Point would mean "for every point whose x is f32 and y is any type"
@coldsir54062 жыл бұрын
@@raffimolero64 thank you sir
@kevinmbtbass2 жыл бұрын
@@coldsir5406 The response doesn't really answer the question. The generic types after the struct name (Point) refer to the fields of the struct, while the generict types after impl (impl) define those types for the methods, etc. inside the impl. For example you may have a Point but you want to be able to add to it with either an int or a float: impl Point { fn add(&self, x: T, y: U) {...} }
@coldsir54062 жыл бұрын
@@kevinmbtbass got it in the end, thanks
@DMZT_dhruv4 ай бұрын
background music name???
@muneebakhlaq30853 жыл бұрын
Nice video
@SemiMono2 жыл бұрын
New music! :D
@christosbinos84672 жыл бұрын
is self in rust similar to this in javascript?
@Gramini2 жыл бұрын
Yes. self / this both refer to the object/struct that the method is defined for.
@samuelwittlinger7790 Жыл бұрын
It doesn't slow down performance but it should be noted that heavy use of generics makes your binaries larger.
@caseyyeow16493 жыл бұрын
Excellent video. Is there a faint background music behind? Quite irritating when you want to concentrate. Thanks. 🙏
@letsgetrusty3 жыл бұрын
Music is improved in future videos!
@caseyyeow16493 жыл бұрын
@@letsgetrusty No worry. Thx for your excellent video which I would definitely watch first before dive into the detail doc.
@caseyyeow16493 жыл бұрын
@@letsgetrusty Oh, perhaps without any music would be better? Thx.
@exoticcoder53653 жыл бұрын
@@letsgetrusty I’m the opposite I find the background music helps me to concentrate more on what you said in the video 😂😂😂
@exoticcoder53653 жыл бұрын
I’m the opposite I find the background music helps me to concentrate more on what he said in the video 😂😂😂
@ramanShariati2 жыл бұрын
awesome
@ehsanisa37592 жыл бұрын
chad bogdan
@poonikarthu49882 жыл бұрын
Instead of taking in a vector of integers, we want to take in a vector of TEA.
@WaiTingKuo05272 жыл бұрын
better use Ord instead. Partial order doesn't guarantee global maximum exist (mathemetically)
@naitikmakwana4286 Жыл бұрын
backgroud music is very distracting..please try to avoid it
@kmaximoff7 ай бұрын
everything is great, except background music is annoying. Makes it hard to focus.
@pynchia41192 жыл бұрын
you need to work on the lighting: you seem to be wearing a mask around your eyes or having been up all night...
@1234fewgfwe5 ай бұрын
Dude background music isn’t appropriate for coding tutorial videos please 🤣
@arthurtapper10923 жыл бұрын
Reads straight from Rust book for entire video. "If you don't understand just pause the video and read through." People who read rust book and still don't understand: !?!?! Serioiusly? That's why were here