Rust Traits

What is a trait? A trait is a way to enable reuse methods. We can think about traits that have some of the features of interfaces and abstract classes, and also have other features that these don’t have. We will cover all of these in this blog post. Rust doesn’t have fully Devamı…

Rust iterators

What are iterators in Rust? Anything which implements IntoIterator trait called as an iterator. Vec struct is implements iterator and all vectors are actually an iterator. And for loops are uses iterators in background. let v = vec![1, 2, 3, 4]; for num in v { println!(“num: {}”, num); } for loops are Devamı…