Focus mode

Rust Fundamentals

Fundamental Types:Vectors

Vectors allow you to store multiple values in the same data structure in a single structure. 

Per Rust Official documentation use a vec when:

  • You want to collect items up to be processed or sent elsewhere later, and don’t care about any properties of the actual values being stored.
  • You want a sequence of elements in a particular order, and will only be appending to (or near) the end.
  • You want a stack.
  • You want a resizable array.
  • You want a heap-allocated array.

To understand vectors in more detail, additional resource can be found here:

https://www.youtube.com/watch?v=Zs-pS-egQSs 

You can find detailed further information from Rust Official documentation:

https://doc.rust-lang.org/rust-by-example/std/vec.html

left-disk

Programs to Accelerate Your Progress in a Software Career

Join our 4-8 month intensive Patika+ bootcamps, start with the fundamentals and gain comprehensive knowledge to kickstart your software career!

right-cube

Test

Comments

You need to enroll in the course to be able to comment!