Odak modu
Generics
Generics, traits and lifetimes are other important subjects that should be learned, since these concepts makes Rust better to its peers. Polymorphism, one of the foundations of object-oriented programming, derives from traits and generics in Rust.
Generics is the structure that prevents duplication in Rust. A syntax that allows the developer to use generic terms as placeholders for more concrete types to be passed in elsewhere and does not require defining different functions of different types. When creating code, we can define generic attributes such as behavior or how they relate to other generics without knowing what will actually be in their place. Generics make the code more flexible.
To understand generics in more detail, additional resource can be found here:
https://www.youtube.com/watch?v=6rcTSxPJ6Bw&t=11s
You can find detailed further information from Rust Official documentation:
https://doc.rust-lang.org/book/ch10-00-generics.html
Resources:
https://www.geeksforgeeks.org/rust-generic-function/
https://alexeden.github.io/learning-rust/programming_rust/11_traits_and_generics.html
Lifetimes
Lifetimes are another kind of generic that ensure references are valid for as long as we need them. To minimize memory usage by reducing unnecessary storage lifetimes are good structs to use.
In Rust, every reference has a lifetime which is the duration for which the reference is valid. Where more than one species is possible, or where references can be associated in several different ways, we should annotate species and lifetimes to avoid problems.
You can find detailed further information from Rust Official documentation:
https://doc.rust-lang.org/book/ch10-03-lifetime-syntax.html
Resources:
https://www.buraksenyurt.com/post/rust-pratikleri-lifetimes-mevzusu(in Turkish)
Sektörde en çok aranan yazılım becerilerini kazan
Yapay zeka desteği, birebir mentörlük saatleri, canlı dersler ve senin için özel hazırlanmış içeriklerle eksiklerini tamamla, düzenli geri bildirimler al ve öğrenme sürecini en verimli hale getir.
Yunus Emre Kabakcı
Patika+ mezunuPatika+ Fullstack Web Development Bootcamp mezunumuz Yunus Emre,
3 ay içinde Katar’dan aldığı teklif ile, global bir şirket olan Pavo Group’da işe başladı!
“İçerik zenginliği, mentor desteği, ileriye dönük bir network sağlaması ve dünyada en çok tercih edilen frameworkler üzerinden bir eğitim veriyor olması Patika+’ı tercih etmemin temel sebepleri oldu!“
Yorum yapabilmek için derse kayıt olmalısın!