title
Rust Crash Course | Rustlang
description
Learn all the fundamentals of the Rust programming language in this crash course.
Sponsor: Eduonix
http://bit.ly/traversymedia
Code:
https://github.com/bradtraversy/rust_sandbox
Timestamps:
Intro - 1:05
Install Rust - 4:45
Creating a file - 6:26
Cargo Init & Build - 7:50
Print & Formatting - 10:42
Variables - 19:35
Data Types - 25:15
Strings - 33:42
Tuples - 44:34
Arrays - 47:14
Vectors - 55:00
Conditionals - 1:16:00
Loops - 1:07:03
Functions - 1:13:53
Pointers & Reference - 1:19:14
Structs - 1:22:00
Enums - 1:37:59
Command Line Args - 1:42:00
💖 Become a Patron: Show support & get perks!
http://www.patreon.com/traversymedia
Website & Udemy Courses
http://www.traversymedia.com
Follow Traversy Media:
https://www.facebook.com/traversymedia
https://www.twitter.com/traversymedia
https://www.instagram.com/traversymedia
detail
{'title': 'Rust Crash Course | Rustlang', 'heatmap': [{'end': 602.611, 'start': 323.948, 'weight': 0.816}, {'end': 731.904, 'start': 661.296, 'weight': 1}, {'end': 3258.074, 'start': 3123.01, 'weight': 0.747}, {'end': 3389.883, 'start': 3321.35, 'weight': 0.796}, {'end': 4719.027, 'start': 4575.652, 'weight': 0.779}, {'end': 4851.082, 'start': 4781.981, 'weight': 0.729}, {'end': 5125.812, 'start': 5045.149, 'weight': 0.962}, {'end': 5518.043, 'start': 5364.093, 'weight': 0.923}], 'summary': "The rust crash course covers topics such as rust's relevance in web development, programming fundamentals, debugging, string data structure, conditionals, loops, and functions, with practical examples and key concepts.", 'chapters': [{'end': 250.472, 'segs': [{'end': 36.024, 'src': 'embed', 'start': 7.148, 'weight': 0, 'content': [{'end': 9.029, 'text': 'This video is sponsored by Eduonics.', 'start': 7.148, 'duration': 1.881}, {'end': 13.812, 'text': "They're running an exclusive sale for Traverse Media subscribers on their best-selling courses,", 'start': 9.069, 'duration': 4.743}, {'end': 17.233, 'text': 'which are available at just $7 for a very limited period of time.', 'start': 13.812, 'duration': 3.421}, {'end': 25.478, 'text': 'You can learn skills such as machine learning and NLP, web development, programming languages like C++, C, Sharp and Java,', 'start': 17.514, 'duration': 7.964}, {'end': 28.239, 'text': 'DevOps technology such as Docker and much more.', 'start': 25.478, 'duration': 2.761}, {'end': 35.043, 'text': 'So click the link in the description below to check out Eduonics courses and start building your skills in 2019.', 'start': 28.52, 'duration': 6.523}, {'end': 36.024, 'text': "hey, what's going on, guys?", 'start': 35.043, 'duration': 0.981}], 'summary': 'Eduonics offers best-selling courses at $7 for traverse media subscribers, covering machine learning, nlp, web dev, programming, and devops.', 'duration': 28.876, 'max_score': 7.148, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/zF34dRivLOw/pics/zF34dRivLOw7148.jpg'}, {'end': 94.912, 'src': 'embed', 'start': 66.965, 'weight': 1, 'content': [{'end': 70.225, 'text': "It's an extremely fast and powerful programming language.", 'start': 66.965, 'duration': 3.26}, {'end': 73.326, 'text': 'Rust is best known for being a systems language.', 'start': 70.625, 'duration': 2.701}, {'end': 77.967, 'text': 'Some other examples of systems languages are C, C++, Golang.', 'start': 73.706, 'duration': 4.261}, {'end': 86.79, 'text': 'These are very powerful and fast languages, built more for systems rather than application programming languages like Java, C, Sharp,', 'start': 78.267, 'duration': 8.523}, {'end': 88.05, 'text': 'JavaScript and so on.', 'start': 86.79, 'duration': 1.26}, {'end': 94.912, 'text': 'So application programming is basically user facing software programs that the users interact with.', 'start': 88.69, 'duration': 6.222}], 'summary': 'Rust is a fast and powerful systems language, similar to c, c++, and golang.', 'duration': 27.947, 'max_score': 66.965, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/zF34dRivLOw/pics/zF34dRivLOw66965.jpg'}, {'end': 194.069, 'src': 'embed', 'start': 127.807, 'weight': 3, 'content': [{'end': 137.073, 'text': "Okay, so it's going to allow us to build very secure, portable and very fast applications, web applications utilizing languages like C++ and,", 'start': 127.807, 'duration': 9.266}, {'end': 137.913, 'text': 'of course, Rust.', 'start': 137.073, 'duration': 0.84}, {'end': 144.618, 'text': "So if you want to get into WebAssembly but you don't want to work with C++, which is a very, very difficult language to work with,", 'start': 138.414, 'duration': 6.204}, {'end': 146.099, 'text': 'then Rust is perfect.', 'start': 144.978, 'duration': 1.121}, {'end': 150.702, 'text': 'So Rust and WebAssembly integrate with existing JavaScript tooling.', 'start': 146.579, 'duration': 4.123}, {'end': 156.307, 'text': 'It supports, you know, ECMAScript modules as well as tools like NPM and Webpack.', 'start': 151.263, 'duration': 5.044}, {'end': 160.43, 'text': 'I do have plans on creating a Rust and WebAssembly project on YouTube.', 'start': 156.647, 'duration': 3.783}, {'end': 163.352, 'text': 'So this is going to be sort of a precursor to that.', 'start': 160.93, 'duration': 2.422}, {'end': 174.22, 'text': "OK. so if you're a web developer wanting to learn Rust and Wasm or you're just looking to learn a systems language to build whatever compilers, drivers,", 'start': 163.812, 'duration': 10.408}, {'end': 179.032, 'text': 'stuff like that, then this is kind of an introductory to that.', 'start': 175.107, 'duration': 3.925}, {'end': 180.383, 'text': 'All right.', 'start': 180.063, 'duration': 0.32}, {'end': 184.685, 'text': 'Now, one more thing I want to talk about before we get started is garbage collection.', 'start': 180.463, 'duration': 4.222}, {'end': 191.188, 'text': "One of the biggest advantages to Rust is that it doesn't have garbage collection and you also don't have to manage memory.", 'start': 185.105, 'duration': 6.083}, {'end': 194.069, 'text': 'So, and let me explain what that means now.', 'start': 191.888, 'duration': 2.181}], 'summary': 'Rust enables secure, fast web apps, integrates with js tools, no garbage collection.', 'duration': 66.262, 'max_score': 127.807, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/zF34dRivLOw/pics/zF34dRivLOw127807.jpg'}, {'end': 239.19, 'src': 'embed', 'start': 214.998, 'weight': 8, 'content': [{'end': 223.002, 'text': 'With languages like C and C++, you handle all this yourself, which makes programming much more tedious, much harder.', 'start': 214.998, 'duration': 8.004}, {'end': 226.084, 'text': 'You have to manage all the memory, the allocation and all that stuff.', 'start': 223.042, 'duration': 3.042}, {'end': 227.044, 'text': "It's very difficult.", 'start': 226.124, 'duration': 0.92}, {'end': 230.686, 'text': 'Now, Rust works in a different way than both of these.', 'start': 227.625, 'duration': 3.061}, {'end': 239.19, 'text': "You don't have to manage it yourself, but instead of it automatically checking every few milliseconds or whatever, It checks on demand when needed.", 'start': 230.766, 'duration': 8.424}], 'summary': 'Rust simplifies programming by automating memory management, unlike c and c++.', 'duration': 24.192, 'max_score': 214.998, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/zF34dRivLOw/pics/zF34dRivLOw214998.jpg'}], 'start': 7.148, 'title': "Rust's relevance in web development", 'summary': "Discusses eduonics' exclusive sale on rust courses for traverse media subscribers at $7 and introduces a rust crash course. it also highlights rust's relevance in web development due to webassembly, its advantages, and memory management.", 'chapters': [{'end': 110.677, 'start': 7.148, 'title': 'Eduonics exclusive sale and rust crash course', 'summary': "Discusses an exclusive sale on eduonics' best-selling courses for traverse media subscribers at $7, and introduces a crash course on the fundamentals and syntax of the rust programming language, highlighting its speed and power as a systems language.", 'duration': 103.529, 'highlights': ['Eduonics is offering an exclusive sale for Traverse Media subscribers on their best-selling courses at $7 for a limited time, covering skills like machine learning, NLP, web development, and programming languages like C++, C, Sharp, and Java.', 'The crash course introduces the fundamentals and syntax of Rust, emphasizing its speed and power as a systems language, similar to C, C++, and Golang, and its suitability for building tools like drivers and compilers.', 'Rust is highlighted as an extremely fast and powerful systems language, suitable for building tools like drivers and compilers, and is compared to other systems languages such as C, C++, and Golang.']}, {'end': 174.22, 'start': 110.757, 'title': 'Rust & webassembly in web dev', 'summary': 'Highlights the relevance of rust in web development due to webassembly, its advantages in building secure and fast web applications, and its integration with existing javascript tooling, appealing to web developers and those interested in learning a systems language.', 'duration': 63.463, 'highlights': ["Rust's relevance in web development due to WebAssembly's promising early stages and potential for building secure and fast web applications.", 'The efficiency and advantages of WebAssembly as an efficient low-level bytecode for the web, allowing for the utilization of languages like C++ and Rust.', 'The integration of Rust and WebAssembly with existing JavaScript tooling, supporting ECMAScript modules, NPM, and Webpack, making it appealing to web developers.', 'The appeal of Rust as an alternative to difficult-to-work-with languages like C++, making it perfect for those wanting to get into WebAssembly.', 'The plan to create a Rust and WebAssembly project on YouTube, catering to web developers and those interested in learning a systems language.']}, {'end': 250.472, 'start': 175.107, 'title': 'Rust: advantages of memory management', 'summary': "Discusses the advantage of rust's memory management, highlighting that it eliminates the need for manual memory management like in c and c++, and it checks on demand when needed, reducing the overhead of garbage collection in languages like javascript.", 'duration': 75.365, 'highlights': ['Rust eliminates the need for manual memory management like in C and C++, making programming less tedious and harder.', "Rust's memory management checks on demand when needed, reducing the overhead of garbage collection, which can take multiple seconds in languages like JavaScript.", "In JavaScript, garbage collection can sometimes take multiple seconds depending on the program and what's being collected, due to it automatically looking for variables and objects that are no longer needed within the code."]}], 'duration': 243.324, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/zF34dRivLOw/pics/zF34dRivLOw7148.jpg', 'highlights': ['Eduonics offers exclusive $7 sale for Traverse Media subscribers on best-selling courses covering machine learning, NLP, web development, and programming languages.', 'Rust crash course introduces fundamentals and syntax, emphasizing speed and power as a systems language, similar to C, C++, and Golang.', 'Rust is extremely fast and powerful, suitable for building tools like drivers and compilers, compared to C, C++, and Golang.', "Rust's relevance in web development due to WebAssembly's potential for building secure and fast web applications.", "WebAssembly's efficiency and advantages as an efficient low-level bytecode for the web, allowing utilization of languages like C++ and Rust.", 'Integration of Rust and WebAssembly with existing JavaScript tooling, supporting ECMAScript modules, NPM, and Webpack, appealing to web developers.', 'Rust as an alternative to difficult-to-work-with languages like C++, making it perfect for those wanting to get into WebAssembly.', 'Rust and WebAssembly project creation plan on YouTube, catering to web developers and those interested in learning a systems language.', 'Rust eliminates the need for manual memory management like in C and C++, making programming less tedious and harder.', "Rust's memory management checks on demand when needed, reducing the overhead of garbage collection, which can take multiple seconds in languages like JavaScript."]}, {'end': 1075.733, 'segs': [{'end': 274.185, 'src': 'embed', 'start': 250.552, 'weight': 0, 'content': [{'end': 258.233, 'text': "So it's very efficient and at the same time it's not leaving it up to you to allocate memory and all that stuff that you would do with C++.", 'start': 250.552, 'duration': 7.681}, {'end': 264.095, 'text': "So you kind of get the best of both worlds and I think that's what makes Rust an excellent language.", 'start': 258.454, 'duration': 5.641}, {'end': 274.185, 'text': 'And Rust has its own package manager called Cargo, which is similar to NPM for Node or Composer for PHP, Pipenv for Python.', 'start': 265.2, 'duration': 8.985}], 'summary': 'Rust offers efficiency and ease of memory allocation, with its own package manager called cargo.', 'duration': 23.633, 'max_score': 250.552, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/zF34dRivLOw/pics/zF34dRivLOw250552.jpg'}, {'end': 611.594, 'src': 'heatmap', 'start': 319.946, 'weight': 2, 'content': [{'end': 323.488, 'text': "Rust up is to it's basically your version manager.", 'start': 319.946, 'duration': 3.542}, {'end': 334.233, 'text': "If you want to check for updates, you could do rust up update and that should see if there's any updates and then, you know, update if if needed.", 'start': 323.948, 'duration': 10.285}, {'end': 337.535, 'text': 'Then Rust C is the compiler.', 'start': 335.114, 'duration': 2.421}, {'end': 340.756, 'text': 'So you can see that we have that installed as well.', 'start': 337.635, 'duration': 3.121}, {'end': 344.596, 'text': 'And then cargo is the package manager.', 'start': 340.857, 'duration': 3.739}, {'end': 349.458, 'text': "OK, now what I'm going to do is I'm going to close this up and jump into VS code.", 'start': 344.616, 'duration': 4.842}, {'end': 352.26, 'text': "This is the text editor that I'll be using now.", 'start': 349.498, 'duration': 2.762}, {'end': 353.14, 'text': 'Very important.', 'start': 352.46, 'duration': 0.68}, {'end': 357.162, 'text': "If you're using VS code, you want to install the rust RLS extension.", 'start': 353.18, 'duration': 3.982}, {'end': 361.184, 'text': "OK, so go ahead and search for rust and it's going to be the first one and install that.", 'start': 357.182, 'duration': 4.002}, {'end': 363.305, 'text': 'This has, you know, code completion.', 'start': 361.204, 'duration': 2.101}, {'end': 366.487, 'text': "It's basically a linter for your rust code.", 'start': 363.346, 'duration': 3.141}, {'end': 367.608, 'text': 'So you definitely want that.', 'start': 366.507, 'duration': 1.101}, {'end': 375.056, 'text': "So once you have that installed, I'm just in an empty folder called rust sandbox, and I'm going to be using cargo.", 'start': 368.388, 'duration': 6.668}, {'end': 380.302, 'text': 'But first thing I want to do is just show you how to create a rust file and compile it.', 'start': 375.136, 'duration': 5.166}, {'end': 382.865, 'text': "So I'm going to open up without cargo.", 'start': 380.923, 'duration': 1.942}, {'end': 384.427, 'text': "So I'm going to open up a terminal here.", 'start': 382.925, 'duration': 1.502}, {'end': 386.288, 'text': 'integrated terminal.', 'start': 385.367, 'duration': 0.921}, {'end': 391.11, 'text': "And I'm just going to create a new file called Hello Dot R.S.", 'start': 386.628, 'duration': 4.482}, {'end': 392.191, 'text': "And we're going to open that up.", 'start': 391.11, 'duration': 1.081}, {'end': 396.533, 'text': 'And inside of our rust application, we need an entry point.', 'start': 393.112, 'duration': 3.421}, {'end': 397.854, 'text': 'We need a main function.', 'start': 396.553, 'duration': 1.301}, {'end': 400.616, 'text': "So we're going to say FN main.", 'start': 397.974, 'duration': 2.642}, {'end': 403.397, 'text': "OK, so we're creating a function called main.", 'start': 400.636, 'duration': 2.761}, {'end': 405.939, 'text': 'And then I just want to print out hello world.', 'start': 403.877, 'duration': 2.062}, {'end': 415.171, 'text': "So the command that we're going to be using for the most part in this course to print out stuff is going to be print line or print LN exclamation.", 'start': 406.039, 'duration': 9.132}, {'end': 423.016, 'text': "OK And then here we're just going to put in some double quotes and we'll just say Hello World and save.", 'start': 415.191, 'duration': 7.825}, {'end': 423.877, 'text': 'All right.', 'start': 423.637, 'duration': 0.24}, {'end': 430.782, 'text': 'Now, if we want to compile this and run it, we can use the Rust C utility directly.', 'start': 423.957, 'duration': 6.825}, {'end': 436.886, 'text': 'So we can just say Rust C, hello, and then the file name, hello.rs.', 'start': 430.882, 'duration': 6.004}, {'end': 438.187, 'text': "So we'll run that.", 'start': 437.366, 'duration': 0.821}, {'end': 441.469, 'text': "And now you can see it's created this executable up here.", 'start': 438.307, 'duration': 3.162}, {'end': 446.413, 'text': 'So if I want to run that directly from the command line, I can simply do dot slash hello.', 'start': 442.03, 'duration': 4.383}, {'end': 448.474, 'text': 'And it runs the application.', 'start': 447.053, 'duration': 1.421}, {'end': 450.256, 'text': 'And we get Hello World in the console.', 'start': 448.514, 'duration': 1.742}, {'end': 455.563, 'text': "OK, so I mean, that's you know, you can create a rust file, you can compile it with rusty.", 'start': 450.936, 'duration': 4.627}, {'end': 458.287, 'text': "However, that's not really how you would do it in the real world.", 'start': 455.623, 'duration': 2.664}, {'end': 462.553, 'text': 'You want to initialize your project with cargo and do things that way.', 'start': 458.607, 'duration': 3.946}, {'end': 467.019, 'text': "So I'm going to just delete both of these files right here.", 'start': 462.673, 'duration': 4.346}, {'end': 469.387, 'text': 'All right.', 'start': 469.127, 'duration': 0.26}, {'end': 478.715, 'text': "Now to initialize a project with cargo, there's a there's a couple of different ways we could do cargo new and then a folder name like hello.", 'start': 469.487, 'duration': 9.228}, {'end': 483.059, 'text': 'And what that would do is create a new project in a folder called Hello.', 'start': 479.596, 'duration': 3.463}, {'end': 488.283, 'text': 'However, I want to initialize everything in this rust sandbox folder.', 'start': 483.459, 'duration': 4.824}, {'end': 489.585, 'text': "So I'm going to do cargo in it.", 'start': 488.323, 'duration': 1.262}, {'end': 498.445, 'text': "right. and then, if we look over here, you'll see that we have this file structure and we have a cargo.toml file.", 'start': 491.542, 'duration': 6.903}, {'end': 503.207, 'text': 'now i have an extension called better tomo, which will give us the the highlighting here.', 'start': 498.445, 'duration': 4.762}, {'end': 505.988, 'text': "if you don't have it, this will just be all white.", 'start': 503.207, 'duration': 2.781}, {'end': 516.452, 'text': 'now this has just some information like the name, the version, very similar to like a pip file for python or a package.json for node.', 'start': 505.988, 'duration': 10.464}, {'end': 520.333, 'text': 'it just has all your application info and any dependencies that you have.', 'start': 516.452, 'duration': 3.881}, {'end': 522.554, 'text': "OK, so I'm not going to touch this file.", 'start': 520.953, 'duration': 1.601}, {'end': 523.875, 'text': 'I just wanted to show it to you.', 'start': 522.575, 'duration': 1.3}, {'end': 534.06, 'text': 'And then it gives us a gitignore, which has the target folder because that is basically when we run the compiler, our files will go into there.', 'start': 524.516, 'duration': 9.544}, {'end': 538.362, 'text': "And that's not something you want to push to GitHub or wherever you're pushing it.", 'start': 534.1, 'duration': 4.262}, {'end': 542.144, 'text': 'And then our source folder is where all of our Rust code goes.', 'start': 539.442, 'duration': 2.702}, {'end': 548.987, 'text': "So you can see there's a main.rs file that basically just has the same thing that we created in the hello file.", 'start': 542.264, 'duration': 6.723}, {'end': 555.51, 'text': "Now, when we want to compile this, we don't use the Rust C utility directly.", 'start': 549.647, 'duration': 5.863}, {'end': 556.591, 'text': 'We use cargo.', 'start': 555.57, 'duration': 1.021}, {'end': 559.032, 'text': 'And we can say cargo run.', 'start': 557.451, 'duration': 1.581}, {'end': 564.227, 'text': "What that's going to do is it's going to compile it and it's also going to run it.", 'start': 560.785, 'duration': 3.442}, {'end': 567.069, 'text': 'You can see Hello World is printing out here.', 'start': 564.267, 'duration': 2.802}, {'end': 574.495, 'text': 'Now it compiled into this target folder and then into debug and right here, rust sandbox.', 'start': 567.67, 'duration': 6.825}, {'end': 577.677, 'text': 'OK, so if I wanted to run this, I could go into.', 'start': 574.955, 'duration': 2.722}, {'end': 591.907, 'text': 'we could say dot, slash targets, slash debug, slash, rust underscore sandbox and that will run the actual executable.', 'start': 577.677, 'duration': 14.23}, {'end': 597.068, 'text': "Now, if you just want to build it out and you don't want to run it, you can do cargo build.", 'start': 592.607, 'duration': 4.461}, {'end': 602.611, 'text': "OK, so you can see it's not printing out Hello World, however, it did build it.", 'start': 597.088, 'duration': 5.523}, {'end': 611.594, 'text': 'Now, if you want to build for production, then you want to do cargo build dash dash release.', 'start': 602.671, 'duration': 8.923}], 'summary': 'Rust up manages versions, vs code with rls extension, cargo for package management, and using cargo for project initialization and compilation.', 'duration': 291.648, 'max_score': 319.946, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/zF34dRivLOw/pics/zF34dRivLOw319946.jpg'}, {'end': 534.06, 'src': 'embed', 'start': 503.207, 'weight': 3, 'content': [{'end': 505.988, 'text': "if you don't have it, this will just be all white.", 'start': 503.207, 'duration': 2.781}, {'end': 516.452, 'text': 'now this has just some information like the name, the version, very similar to like a pip file for python or a package.json for node.', 'start': 505.988, 'duration': 10.464}, {'end': 520.333, 'text': 'it just has all your application info and any dependencies that you have.', 'start': 516.452, 'duration': 3.881}, {'end': 522.554, 'text': "OK, so I'm not going to touch this file.", 'start': 520.953, 'duration': 1.601}, {'end': 523.875, 'text': 'I just wanted to show it to you.', 'start': 522.575, 'duration': 1.3}, {'end': 534.06, 'text': 'And then it gives us a gitignore, which has the target folder because that is basically when we run the compiler, our files will go into there.', 'start': 524.516, 'duration': 9.544}], 'summary': 'Introduction to a file containing application info and dependencies, along with a gitignore excluding the target folder.', 'duration': 30.853, 'max_score': 503.207, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/zF34dRivLOw/pics/zF34dRivLOw503207.jpg'}, {'end': 625.011, 'src': 'embed', 'start': 597.088, 'weight': 4, 'content': [{'end': 602.611, 'text': "OK, so you can see it's not printing out Hello World, however, it did build it.", 'start': 597.088, 'duration': 5.523}, {'end': 611.594, 'text': 'Now, if you want to build for production, then you want to do cargo build dash dash release.', 'start': 602.671, 'duration': 8.923}, {'end': 615.945, 'text': "When you do that, you'll see it says finish release optimized.", 'start': 612.603, 'duration': 3.342}, {'end': 617.926, 'text': "So it'll optimize it for production.", 'start': 616.265, 'duration': 1.661}, {'end': 621.228, 'text': "And then in target, you'll see there's a release folder.", 'start': 618.367, 'duration': 2.861}, {'end': 625.011, 'text': "And then that's where the executable is for deployment.", 'start': 621.348, 'duration': 3.663}], 'summary': 'Cargo build optimizes code for production, creating a release folder for deployment.', 'duration': 27.923, 'max_score': 597.088, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/zF34dRivLOw/pics/zF34dRivLOw597088.jpg'}, {'end': 731.904, 'src': 'heatmap', 'start': 645.943, 'weight': 5, 'content': [{'end': 650.047, 'text': "So in the source folder, I'm going to create a new file called print.rs.", 'start': 645.943, 'duration': 4.104}, {'end': 661.036, 'text': 'Now, what we can do is create a function in this print file and then run it in our main main R.S.', 'start': 652.87, 'duration': 8.166}, {'end': 666.48, 'text': "file So I'm going to go pub, which is means public.", 'start': 661.296, 'duration': 5.184}, {'end': 672.245, 'text': 'So public function because I want to be able to access this from outside public function.', 'start': 666.56, 'duration': 5.685}, {'end': 676.027, 'text': "And for each file, I'm going to create a run function just to run it.", 'start': 672.405, 'duration': 3.622}, {'end': 680.231, 'text': "And let's first just do a print to console.", 'start': 676.828, 'duration': 3.403}, {'end': 685.774, 'text': "So I'm going to do the same thing, just do a print LN exclamation.", 'start': 681.451, 'duration': 4.323}, {'end': 692.379, 'text': "And let's just say hello from the print RS file.", 'start': 687.215, 'duration': 5.164}, {'end': 694.3, 'text': "So we'll save that.", 'start': 693.419, 'duration': 0.881}, {'end': 703.826, 'text': 'And then in main.rs, what we want to do is go above the main function and just simply say mod and then the name of the file, which is print.', 'start': 694.58, 'duration': 9.246}, {'end': 706.989, 'text': 'And by the way, semicolons are required in Rust.', 'start': 704.507, 'duration': 2.482}, {'end': 711.039, 'text': "And then down here, let's get rid of this.", 'start': 707.796, 'duration': 3.243}, {'end': 717.544, 'text': 'And we can simply say print double colon and then the function.', 'start': 712.7, 'duration': 4.844}, {'end': 720.887, 'text': "And you'll see it even has a drop down with the run function.", 'start': 717.584, 'duration': 3.303}, {'end': 726.922, 'text': 'OK, so if I save that, we go down here and we say cargo run.', 'start': 721.94, 'duration': 4.982}, {'end': 731.904, 'text': 'We get hello from the print print dot RS file.', 'start': 727.522, 'duration': 4.382}], 'summary': 'Creating a print function in rust with public access, and running it from main.rs.', 'duration': 30.084, 'max_score': 645.943, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/zF34dRivLOw/pics/zF34dRivLOw645943.jpg'}], 'start': 250.552, 'title': 'Rust programming fundamentals', 'summary': "Provides an introduction to rust and its package manager cargo, highlighting its efficiency, ease of use, and features such as cargo.toml file, rustup, and rust c utility for managing and compiling rust projects. it then covers the compilation process using cargo, including building for production with 'cargo build --release' and discusses the structuring of the folder and the creation of a new file for each topic, such as print line command and formatting.", 'chapters': [{'end': 523.875, 'start': 250.552, 'title': 'Introduction to rust and cargo', 'summary': 'Provides an introduction to rust and its package manager cargo, highlighting its efficiency, ease of use, and features such as cargo.toml file, rustup, and rust c utility for managing and compiling rust projects.', 'duration': 273.323, 'highlights': ['Rust is efficient and combines memory allocation features of C++ with the ease of high-level languages, making it an excellent language for development. Rust provides efficiency by combining memory allocation features of C++ with the ease of high-level languages, making it an excellent language for development.', "Rust has its own package manager called Cargo, similar to NPM for Node or Composer for PHP, for installing packages and tracking dependencies. Rust's package manager, Cargo, is similar to NPM for Node or Composer for PHP, enabling the installation of packages and tracking of dependencies.", "Rustup is a version manager for Rust, allowing updates with 'rustup update' command. Rustup serves as a version manager for Rust, facilitating updates with the 'rustup update' command.", 'Cargo.toml file serves as the application info and dependency tracker, similar to package.json for Node or pip file for Python. The cargo.toml file serves as the application info and dependency tracker, similar to package.json for Node or pip file for Python.', 'Rust C is the compiler for Rust, used for managing and compiling Rust projects. Rust C serves as the compiler for Rust, used for managing and compiling Rust projects.']}, {'end': 1075.733, 'start': 524.516, 'title': 'Rust compilation and formatting', 'summary': "Covers the compilation process using cargo, including building for production with 'cargo build --release' and then proceeds to discuss the structuring of the folder and the creation of a new file for each topic, such as print line command and formatting.", 'duration': 551.217, 'highlights': ["The chapter covers the compilation process using cargo, including building for production with 'cargo build --release' Cargo is used for compiling and running the Rust code, and 'cargo build --release' optimizes the code for production.", 'The chapter discusses the structuring of the folder and the creation of a new file for each topic, such as print line command and formatting The folder is structured to create a new file for each topic, and the print line command and formatting are demonstrated through the creation of a new file called print.rs and running it in the main.rs file.']}], 'duration': 825.181, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/zF34dRivLOw/pics/zF34dRivLOw250552.jpg', 'highlights': ['Rust provides efficiency by combining memory allocation features of C++ with the ease of high-level languages, making it an excellent language for development.', "Rust's package manager, Cargo, is similar to NPM for Node or Composer for PHP, enabling the installation of packages and tracking of dependencies.", "Rustup serves as a version manager for Rust, facilitating updates with the 'rustup update' command.", 'The cargo.toml file serves as the application info and dependency tracker, similar to package.json for Node or pip file for Python.', "Cargo is used for compiling and running the Rust code, and 'cargo build --release' optimizes the code for production.", 'The folder is structured to create a new file for each topic, and the print line command and formatting are demonstrated through the creation of a new file called print.rs and running it in the main.rs file.']}, {'end': 1631.836, 'segs': [{'end': 1108.88, 'src': 'embed', 'start': 1077.481, 'weight': 2, 'content': [{'end': 1087.112, 'text': 'now we also have the debug trait, which is which comes in handy if, um, if you want to print out like an entire array or something like that.', 'start': 1077.481, 'duration': 9.631}, {'end': 1094.62, 'text': "so let's say placeholder for debug trait and we'll be using this quite a bit.", 'start': 1087.112, 'duration': 7.508}, {'end': 1105.559, 'text': "so we're going to say print line, And this is going to be a colon and then a question mark.", 'start': 1094.62, 'duration': 10.939}, {'end': 1108.88, 'text': 'Now, with this, I can actually put in multiple values.', 'start': 1105.639, 'duration': 3.241}], 'summary': 'The debug trait allows printing out entire arrays, and can be used for multiple values.', 'duration': 31.399, 'max_score': 1077.481, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/zF34dRivLOw/pics/zF34dRivLOw1077481.jpg'}, {'end': 1228.407, 'src': 'embed', 'start': 1196.753, 'weight': 1, 'content': [{'end': 1200.28, 'text': "And let's create our run function.", 'start': 1196.753, 'duration': 3.527}, {'end': 1208.328, 'text': 'And I just have some stuff that I want to paste up here, just some information.', 'start': 1204.184, 'duration': 4.144}, {'end': 1210.39, 'text': 'I might do this in a couple of different files.', 'start': 1208.348, 'duration': 2.042}, {'end': 1214.274, 'text': 'So variables hold primitive data or references to data.', 'start': 1210.911, 'duration': 3.363}, {'end': 1220.28, 'text': "Variables are immutable by default, meaning that by default you can't reassign them.", 'start': 1214.914, 'duration': 5.366}, {'end': 1228.407, 'text': "OK Rust is also a block scoped language, meaning that, you know, if you set a variable in a function, it's it's it pertains to that scope.", 'start': 1220.3, 'duration': 8.107}], 'summary': 'Rust is a block scoped language, where variables are immutable by default.', 'duration': 31.654, 'max_score': 1196.753, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/zF34dRivLOw/pics/zF34dRivLOw1196753.jpg'}, {'end': 1631.836, 'src': 'embed', 'start': 1606.827, 'weight': 0, 'content': [{'end': 1617.841, 'text': 'You also have tuples, which are basically lists, and then you have arrays, which are also primitive types, but arrays in Rust are a fixed length.', 'start': 1606.827, 'duration': 11.014}, {'end': 1625.491, 'text': "You have something called vectors, which are basically growable arrays, and we'll talk about those after.", 'start': 1618.442, 'duration': 7.049}, {'end': 1629.674, 'text': "I'm not even going to get into tuples and arrays in this file here.", 'start': 1626.412, 'duration': 3.262}, {'end': 1631.836, 'text': 'But these are primitive types of Rust.', 'start': 1630.115, 'duration': 1.721}], 'summary': 'Rust has tuples, arrays, and vectors as primitive types, with arrays being of fixed length.', 'duration': 25.009, 'max_score': 1606.827, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/zF34dRivLOw/pics/zF34dRivLOw1606827.jpg'}], 'start': 1077.481, 'title': 'Rust debugging and variables', 'summary': 'Introduces the debug trait in rust for printing arrays, and demonstrates the use of tuples and basic math operations. it also covers the creation of variables, their immutability, and primitive data types in rust.', 'chapters': [{'end': 1171.003, 'start': 1077.481, 'title': 'Debug trait and tuple in rust', 'summary': 'Introduces the debug trait in rust for printing arrays and demonstrates the use of tuples and basic math operations through print line, showcasing the ability to print multiple values and perform arithmetic operations.', 'duration': 93.522, 'highlights': ['The chapter introduces the debug trait in Rust for printing arrays, utilizing print line with a colon and question mark to print multiple values.', 'Demonstrates the use of tuples in Rust, showcasing the ability to print multiple values using curly braces and discussing the concept of tuples.', 'Illustrates basic math operations in Rust using print line, demonstrating addition and showcasing the expression 10 plus 10 equals 20.']}, {'end': 1631.836, 'start': 1171.023, 'title': 'Rust variables and data types', 'summary': 'Discusses the creation of variables, their immutability by default, the use of the let keyword, and the assignment of multiple variables at once. it also covers the primitive data types in rust, including integers, floats, booleans, characters, and arrays.', 'duration': 460.813, 'highlights': ["Variables are immutable by default, requiring the use of the 'let' keyword for creation and 'mut' to make them mutable. The chapter emphasizes that variables in Rust are immutable by default, necessitating the use of the 'let' keyword for creation and the addition of 'mut' to make them mutable.", "Demonstrates the use of 'const' for defining constants and explicitly specifying the type, such as 'i32'. The chapter demonstrates the use of 'const' for defining constants in Rust, explicitly specifying the type, such as 'i32'.", 'Explains the primitive data types in Rust, including integers, floats, booleans, characters, tuples, arrays, and vectors. The chapter explains the primitive data types in Rust, encompassing integers, floats, booleans, characters, tuples, arrays, and vectors.']}], 'duration': 554.355, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/zF34dRivLOw/pics/zF34dRivLOw1077481.jpg', 'highlights': ['The chapter explains the primitive data types in Rust, encompassing integers, floats, booleans, characters, tuples, arrays, and vectors.', "Variables are immutable by default, requiring the use of the 'let' keyword for creation and 'mut' to make them mutable.", 'The chapter introduces the debug trait in Rust for printing arrays, utilizing print line with a colon and question mark to print multiple values.']}, {'end': 2524.839, 'segs': [{'end': 1660.64, 'src': 'embed', 'start': 1632.477, 'weight': 6, 'content': [{'end': 1635.099, 'text': "Now I'm going to paste in another little tip here.", 'start': 1632.477, 'duration': 2.622}, {'end': 1645.228, 'text': 'And that is that Rust is a statically typed language, which means that it must know the types of all variables at the time of compile.', 'start': 1636.36, 'duration': 8.868}, {'end': 1651.093, 'text': 'However, the compiler can usually infer what type we want to use based on the value and how we use it.', 'start': 1645.708, 'duration': 5.385}, {'end': 1656.817, 'text': "So it's not required that you set the type for every single variable you create.", 'start': 1651.153, 'duration': 5.664}, {'end': 1660.64, 'text': "It's going to infer what that type is going to be.", 'start': 1657.338, 'duration': 3.302}], 'summary': 'Rust is a statically typed language that can usually infer variable types at compile time, reducing the need for explicit type declarations.', 'duration': 28.163, 'max_score': 1632.477, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/zF34dRivLOw/pics/zF34dRivLOw1632477.jpg'}, {'end': 1922.113, 'src': 'embed', 'start': 1878.362, 'weight': 1, 'content': [{'end': 1881.103, 'text': 'We can also get a Boolean from an expression.', 'start': 1878.362, 'duration': 2.741}, {'end': 1895.871, 'text': 'So if we were to do like let is oh, by the way, this the convention for variables is underscore.', 'start': 1887.384, 'duration': 8.487}, {'end': 1900.635, 'text': "You're not going to see like camel case too much here in rust.", 'start': 1896.171, 'duration': 4.464}, {'end': 1906.459, 'text': "So let's do is greater is greater.", 'start': 1900.695, 'duration': 5.764}, {'end': 1910.522, 'text': "And let's set that to ten is greater than five.", 'start': 1906.82, 'duration': 3.702}, {'end': 1922.113, 'text': 'Okay, so what should happen is it should evaluate this and put that value either true or false in here.', 'start': 1915.589, 'duration': 6.524}], 'summary': 'Using expressions to obtain a boolean value, setting is_greater to the result of 10 > 5.', 'duration': 43.751, 'max_score': 1878.362, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/zF34dRivLOw/pics/zF34dRivLOw1878362.jpg'}, {'end': 2039.833, 'src': 'embed', 'start': 2011.907, 'weight': 2, 'content': [{'end': 2014.949, 'text': "And you'll see that we get a little smiley emoji face.", 'start': 2011.907, 'duration': 3.042}, {'end': 2018.252, 'text': 'Okay And you can look these Unicodes up online.', 'start': 2014.969, 'duration': 3.283}, {'end': 2021.495, 'text': 'Just type in emoji Unicode and you can find these.', 'start': 2018.312, 'duration': 3.183}, {'end': 2022.736, 'text': 'All right.', 'start': 2021.515, 'duration': 1.221}, {'end': 2025.398, 'text': "So I think that's good for primitive types.", 'start': 2022.816, 'duration': 2.582}, {'end': 2027.04, 'text': "So now we're going to look at strings.", 'start': 2025.598, 'duration': 1.442}, {'end': 2030.262, 'text': 'Talk about those for a little bit and also look at some string methods.', 'start': 2027.18, 'duration': 3.082}, {'end': 2033.885, 'text': "So I'm going to create a new file and I'm going to call it strings.rs.", 'start': 2030.322, 'duration': 3.563}, {'end': 2039.833, 'text': "And let's create our public function run.", 'start': 2036.87, 'duration': 2.963}], 'summary': 'Introduction to unicode and string methods in rust.', 'duration': 27.926, 'max_score': 2011.907, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/zF34dRivLOw/pics/zF34dRivLOw2011907.jpg'}, {'end': 2115.019, 'src': 'embed', 'start': 2068.54, 'weight': 0, 'content': [{'end': 2071.48, 'text': 'really there you have a primitive string which is immutable.', 'start': 2068.54, 'duration': 2.94}, {'end': 2074.041, 'text': "it's a fixed length string somewhere in memory.", 'start': 2071.48, 'duration': 2.561}, {'end': 2077.322, 'text': "so what we've been doing with strings so far?", 'start': 2074.041, 'duration': 3.281}, {'end': 2079.523, 'text': "we've been using, uh, primitive strings.", 'start': 2077.322, 'duration': 2.201}, {'end': 2085.789, 'text': 'but you also have the string type, which is a growable heap allocated data structure, okay,', 'start': 2079.523, 'duration': 6.266}, {'end': 2089.431, 'text': 'that you can use when you need to modify or own string data.', 'start': 2085.789, 'duration': 3.642}, {'end': 2098.401, 'text': "so if you want to push something onto a string, you can do that as if it were like, let's say, an array or something like that, or a vector,", 'start': 2089.431, 'duration': 8.97}, {'end': 2101.344, 'text': "rather in rust, and we'll get to arrays and vectors in a little bit.", 'start': 2098.401, 'duration': 2.943}, {'end': 2105.854, 'text': 'Now, as far as creating a string, I mean we can do like you know.', 'start': 2101.945, 'duration': 3.909}, {'end': 2111.997, 'text': 'let hello equals Hello, like that.', 'start': 2105.854, 'duration': 6.143}, {'end': 2113.278, 'text': 'And this is this type.', 'start': 2112.217, 'duration': 1.061}, {'end': 2115.019, 'text': "OK, so it's immutable fixed length.", 'start': 2113.298, 'duration': 1.721}], 'summary': 'Immutable primitive string and growable heap allocated data structure for modifying string data.', 'duration': 46.479, 'max_score': 2068.54, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/zF34dRivLOw/pics/zF34dRivLOw2068540.jpg'}, {'end': 2179.746, 'src': 'embed', 'start': 2144.794, 'weight': 4, 'content': [{'end': 2151.799, 'text': "Now, if we want to get the length, let's say get.", 'start': 2144.794, 'duration': 7.005}, {'end': 2158.184, 'text': 'Get length, we can use the Len method, which will actually work for either type of primitive string or this type of string.', 'start': 2151.819, 'duration': 6.365}, {'end': 2163.869, 'text': "So let's do print line and let's say length.", 'start': 2159.245, 'duration': 4.624}, {'end': 2168.753, 'text': 'And then we can do hello dot Len.', 'start': 2165.91, 'duration': 2.843}, {'end': 2179.746, 'text': 'OK so if we run that we get length five now using this type of string we can actually add on to it.', 'start': 2170.923, 'duration': 8.823}], 'summary': "Using the len method, the string 'hello' has a length of 5.", 'duration': 34.952, 'max_score': 2144.794, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/zF34dRivLOw/pics/zF34dRivLOw2144794.jpg'}, {'end': 2455.459, 'src': 'embed', 'start': 2425.973, 'weight': 5, 'content': [{'end': 2427.474, 'text': "So we'll go down here, we'll run it.", 'start': 2425.973, 'duration': 1.501}, {'end': 2430.696, 'text': 'And now you can see for replace, we have hello there.', 'start': 2428.174, 'duration': 2.522}, {'end': 2437.785, 'text': "Now we can also loop through strings like let's say we want to loop through by white space.", 'start': 2431.957, 'duration': 5.828}, {'end': 2442.152, 'text': 'So each word will be put on a new line or we can do whatever we want with it.', 'start': 2438.246, 'duration': 3.906}, {'end': 2444.736, 'text': "So I'm going to say loop through string by.", 'start': 2442.533, 'duration': 2.203}, {'end': 2451.697, 'text': 'white space so we can use a for loop.', 'start': 2449.215, 'duration': 2.482}, {'end': 2453.998, 'text': "I'm just going to say word.", 'start': 2452.677, 'duration': 1.321}, {'end': 2455.459, 'text': 'You can use whatever you want here.', 'start': 2454.038, 'duration': 1.421}], 'summary': 'Demonstrating string manipulation and looping through characters and words.', 'duration': 29.486, 'max_score': 2425.973, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/zF34dRivLOw/pics/zF34dRivLOw2425973.jpg'}], 'start': 1632.477, 'title': 'Rust language basics and string data structure in rust', 'summary': 'Covers rust language basics including type inference, explicit typing, and working with strings, as well as delves into the string data structure in rust, highlighting differences between primitive and heap-allocated strings, and demonstrating various string methods.', 'chapters': [{'end': 2068.54, 'start': 1632.477, 'title': 'Rust language basics', 'summary': 'Covers the basics of rust language, including type inference, explicit typing, finding max size of integers, setting a boolean, getting a boolean from an expression, using unicode characters, and introducing strings in rust.', 'duration': 436.063, 'highlights': ['Rust is a statically typed language, but the compiler can usually infer the type based on the value and usage. The Rust language is statically typed, but the compiler can usually infer the type based on the value and usage, reducing the need for explicit type declarations.', 'Setting a Boolean in Rust, both implicitly and explicitly, and getting a Boolean from an expression. The chapter demonstrates setting a Boolean in Rust, both implicitly and explicitly, and getting a Boolean from an expression, showcasing the flexibility in working with Booleans.', 'Using Unicode characters, including emojis, in Rust. The transcript shows the use of Unicode characters, including emojis, in Rust, highlighting the support for Unicode characters and the ability to work with them in Rust.', 'Introducing strings in Rust and discussing string methods. The chapter introduces strings in Rust and discusses string methods, providing an overview of working with strings in Rust programming.']}, {'end': 2524.839, 'start': 2068.54, 'title': 'String data structure in rust', 'summary': 'Discusses the string data structure in rust, highlighting the difference between primitive strings and heap-allocated strings, demonstrating methods such as creating, modifying, getting length, capacity, checking for emptiness, containing substrings, replacing, and looping through strings.', 'duration': 456.299, 'highlights': ['The string type in Rust is a growable heap-allocated data structure, allowing modification of string data, unlike the immutable fixed length primitive string.', 'Demonstrated methods such as getting the length of a string using the Len method, adding characters and strings using push and push STR, getting capacity in bytes, checking if the string is empty, and checking if it contains a substring.', 'Illustrated the usage of the replace method to replace a substring within the string, and looping through strings by splitting them by white space and outputting each word separately.']}], 'duration': 892.362, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/zF34dRivLOw/pics/zF34dRivLOw1632477.jpg', 'highlights': ['The string type in Rust is a growable heap-allocated data structure, allowing modification of string data, unlike the immutable fixed length primitive string.', 'Setting a Boolean in Rust, both implicitly and explicitly, and getting a Boolean from an expression. The chapter demonstrates setting a Boolean in Rust, both implicitly and explicitly, and getting a Boolean from an expression, showcasing the flexibility in working with Booleans.', 'Using Unicode characters, including emojis, in Rust. The transcript shows the use of Unicode characters, including emojis, in Rust, highlighting the support for Unicode characters and the ability to work with them in Rust.', 'Introducing strings in Rust and discussing string methods. The chapter introduces strings in Rust and discusses string methods, providing an overview of working with strings in Rust programming.', 'Demonstrated methods such as getting the length of a string using the Len method, adding characters and strings using push and push STR, getting capacity in bytes, checking if the string is empty, and checking if it contains a substring.', 'Illustrated the usage of the replace method to replace a substring within the string, and looping through strings by splitting them by white space and outputting each word separately.', 'Rust is a statically typed language, but the compiler can usually infer the type based on the value and usage. The Rust language is statically typed, but the compiler can usually infer the type based on the value and usage, reducing the need for explicit type declarations.']}, {'end': 3629.652, 'segs': [{'end': 2555.188, 'src': 'embed', 'start': 2525.659, 'weight': 1, 'content': [{'end': 2530.562, 'text': "So let's go ahead and just create a mutatable string.", 'start': 2525.659, 'duration': 4.903}, {'end': 2536.485, 'text': "We'll call it S and we'll set it to a string and we're going to say with capacity.", 'start': 2530.582, 'duration': 5.903}, {'end': 2539.986, 'text': "Okay And then let's just make the capacity 10.", 'start': 2536.505, 'duration': 3.481}, {'end': 2545.289, 'text': "Now I'm going to take that string and just push on to it a character.", 'start': 2539.986, 'duration': 5.303}, {'end': 2547.702, 'text': 'So you single quotes here.', 'start': 2546.221, 'duration': 1.481}, {'end': 2552.046, 'text': 'So a character literal is just one Unicode character.', 'start': 2547.782, 'duration': 4.264}, {'end': 2555.188, 'text': "Let's do A and then let's do B.", 'start': 2552.406, 'duration': 2.782}], 'summary': "Creating a mutable string 's' with a capacity of 10 and pushing characters 'a' and 'b' onto it.", 'duration': 29.529, 'max_score': 2525.659, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/zF34dRivLOw/pics/zF34dRivLOw2525659.jpg'}, {'end': 2837.561, 'src': 'embed', 'start': 2809.241, 'weight': 3, 'content': [{'end': 2812.642, 'text': 'code, it knows that the person tuple has three values.', 'start': 2809.241, 'duration': 3.401}, {'end': 2814.482, 'text': 'So we want the first one, which is zero.', 'start': 2812.682, 'duration': 1.8}, {'end': 2816.123, 'text': "Then we'll do person.", 'start': 2814.983, 'duration': 1.14}, {'end': 2819.969, 'text': "Dot one and then we'll do person dot two.", 'start': 2816.687, 'duration': 3.282}, {'end': 2828.915, 'text': 'OK So if we save that and we run our main file we get Brad is from mass and is 37.', 'start': 2819.989, 'duration': 8.926}, {'end': 2831.677, 'text': "OK So that's that's pretty much it.", 'start': 2828.915, 'duration': 2.762}, {'end': 2834.059, 'text': 'Two pools are pretty simple to understand.', 'start': 2831.777, 'duration': 2.282}, {'end': 2837.561, 'text': 'So the next thing I want to look at is arrays.', 'start': 2834.919, 'duration': 2.642}], 'summary': "Using code, accessing person tuple to display brad's information (age, location).", 'duration': 28.32, 'max_score': 2809.241, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/zF34dRivLOw/pics/zF34dRivLOw2809241.jpg'}, {'end': 3258.074, 'src': 'heatmap', 'start': 3123.01, 'weight': 0.747, 'content': [{'end': 3133.172, 'text': "And then here let's do STD double colon mem and then we can do another double colon and we can get the size of Val.", 'start': 3123.01, 'duration': 10.162}, {'end': 3134.993, 'text': 'All right.', 'start': 3134.693, 'duration': 0.3}, {'end': 3138.373, 'text': 'And we want to pass in a reference to the array of numbers.', 'start': 3135.073, 'duration': 3.3}, {'end': 3140.414, 'text': 'So we want to do ampersand numbers.', 'start': 3138.413, 'duration': 2.001}, {'end': 3143.54, 'text': 'All right.', 'start': 3143.26, 'duration': 0.28}, {'end': 3144.861, 'text': "And then let's run that.", 'start': 3143.64, 'duration': 1.221}, {'end': 3149.402, 'text': "Why? Sometimes the errors take a minute to clear and it's confusing.", 'start': 3144.981, 'duration': 4.421}, {'end': 3153.063, 'text': 'So we get array occupies 20 bytes.', 'start': 3150.542, 'duration': 2.521}, {'end': 3163.827, 'text': "OK, if I get rid of let's, let's change this to four and get rid of one of these and save it,", 'start': 3154.324, 'duration': 9.503}, {'end': 3167.968, 'text': 'and then we run this again and we get array occupy 16 bytes.', 'start': 3163.827, 'duration': 4.141}, {'end': 3170.849, 'text': 'OK, so basically each one of these is going to be four bytes.', 'start': 3168.168, 'duration': 2.681}, {'end': 3180.83, 'text': 'So now this STD, the standard library we brought in mem, if we want, we can bring that in up here.', 'start': 3172.561, 'duration': 8.269}, {'end': 3185.815, 'text': 'We can say use STD mem.', 'start': 3181.23, 'duration': 4.585}, {'end': 3194.004, 'text': 'And then down here, we can simply say mem and get rid of the STD, which is always a good thing to get rid of STDs.', 'start': 3187.377, 'duration': 6.627}, {'end': 3198.066, 'text': "so let's run that and we get the same thing, okay.", 'start': 3195.158, 'duration': 2.908}, {'end': 3202.6, 'text': 'so, um, this is this is pretty common to bring it in up here and then just use it.', 'start': 3198.066, 'duration': 4.534}, {'end': 3207.543, 'text': 'Now, another thing we can do is we can get slices from an array.', 'start': 3203.24, 'duration': 4.303}, {'end': 3212.586, 'text': "So let's say get slice.", 'start': 3208.123, 'duration': 4.463}, {'end': 3216.449, 'text': "So I'm just going to create a mutable variable.", 'start': 3212.686, 'duration': 3.763}, {'end': 3218.01, 'text': "Actually, it doesn't need to be mutable.", 'start': 3216.829, 'duration': 1.181}, {'end': 3220.171, 'text': "We'll just call this slice.", 'start': 3218.35, 'duration': 1.821}, {'end': 3223.033, 'text': 'And we want to set the type here.', 'start': 3221.292, 'duration': 1.741}, {'end': 3227.696, 'text': "And we're going to use the ampersand and then brackets and say this is int32.", 'start': 3223.053, 'duration': 4.643}, {'end': 3232.764, 'text': 'and then set it to a reference to the array of numbers.', 'start': 3229.341, 'duration': 3.423}, {'end': 3238.148, 'text': 'So ampersand numbers and we can we can to get the whole thing.', 'start': 3232.844, 'duration': 5.304}, {'end': 3241.531, 'text': "In fact, I'll do that first and then we'll just print,", 'start': 3238.188, 'duration': 3.343}, {'end': 3254.992, 'text': "I'll say slice colon and then over here we'll just pass in slice like that and Let's see what's going on here.", 'start': 3241.531, 'duration': 13.461}, {'end': 3258.074, 'text': "Oh, since this is since it's an array, it's going to print out.", 'start': 3255.152, 'duration': 2.922}], 'summary': 'Demonstration of memory usage and array manipulation in rust, with a 20-byte array occupying 16 bytes when modified.', 'duration': 135.064, 'max_score': 3123.01, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/zF34dRivLOw/pics/zF34dRivLOw3123010.jpg'}, {'end': 3389.883, 'src': 'heatmap', 'start': 3299.78, 'weight': 0, 'content': [{'end': 3307.502, 'text': 'Now I want to take a look at vectors next, which are arrays that you can actually add to and remove stuff from.', 'start': 3299.78, 'duration': 7.722}, {'end': 3309.262, 'text': "So let's create a new file.", 'start': 3307.662, 'duration': 1.6}, {'end': 3312.745, 'text': "We'll call this vectors.rs.", 'start': 3310.384, 'duration': 2.361}, {'end': 3316.487, 'text': "And you're probably going to use vectors more than arrays.", 'start': 3313.446, 'duration': 3.041}, {'end': 3321.33, 'text': "I'm going to copy this, though.", 'start': 3318.048, 'duration': 3.282}, {'end': 3326.432, 'text': "I'm going to copy the whole arrays file and paste it in and just replace some stuff here.", 'start': 3321.35, 'duration': 5.082}, {'end': 3331.555, 'text': 'So vectors are resizable arrays.', 'start': 3326.532, 'duration': 5.023}, {'end': 3345.349, 'text': 'And To define a vector, we can do it basically the same way, except instead of doing this, we define it as vec.', 'start': 3332.836, 'duration': 12.513}, {'end': 3351.637, 'text': 'And then inside angle brackets, we put the data type, which will be I 32.', 'start': 3346.215, 'duration': 5.422}, {'end': 3358.079, 'text': 'And then right before the brackets here, we want to put VEC exclamation that will define it as a vector.', 'start': 3351.637, 'duration': 6.442}, {'end': 3361.82, 'text': 'Now we can still reassign values like this.', 'start': 3358.739, 'duration': 3.081}, {'end': 3364.581, 'text': "We'll go ahead and print it out.", 'start': 3363.501, 'duration': 1.08}, {'end': 3365.882, 'text': 'We can get single values.', 'start': 3364.621, 'duration': 1.261}, {'end': 3369.143, 'text': "It's going to be the same thing down here, the array length.", 'start': 3365.942, 'duration': 3.201}, {'end': 3372.604, 'text': "I'm just going to change this to vector length.", 'start': 3369.183, 'duration': 3.421}, {'end': 3375.385, 'text': "We'll say get vector length.", 'start': 3373.824, 'duration': 1.561}, {'end': 3382.895, 'text': 'And vector.', 'start': 3381.994, 'duration': 0.901}, {'end': 3387.701, 'text': "All right, so let's actually save that.", 'start': 3385.798, 'duration': 1.903}, {'end': 3389.883, 'text': "And let's go to main.rs.", 'start': 3387.801, 'duration': 2.082}], 'summary': 'Introduction to vectors in rust, demonstrating their resizable nature and usage with data types like i32.', 'duration': 66.102, 'max_score': 3299.78, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/zF34dRivLOw/pics/zF34dRivLOw3299780.jpg'}], 'start': 2525.659, 'title': 'Rust programming fundamentals', 'summary': 'Delves into rust programming fundamentals, covering strings, assertions, tuples, arrays, slices, memory allocation, and vectors. it includes examples demonstrating string manipulation, tuple creation, array access, memory allocation, and vector operations.', 'chapters': [{'end': 2677.578, 'start': 2525.659, 'title': 'Rust programming: strings and assertions', 'summary': 'Demonstrates the creation and manipulation of mutable strings in rust, including setting capacity, appending characters, and using assertions to test equality, with examples showing assertion failure and success.', 'duration': 151.919, 'highlights': ['The chapter demonstrates the creation and manipulation of mutable strings in Rust, including setting capacity, appending characters, and using assertions to test equality, with examples showing assertion failure and success.', 'The method assert_equal in Rust takes in two parameters and matches the left to the right, allowing the testing of equality, as demonstrated with examples showing assertion failure and success.', 'The chapter showcases the use of assertions in Rust programming, with examples demonstrating how to test for equality and showing the helpfulness of assertions in identifying failures.']}, {'end': 2957.13, 'start': 2677.598, 'title': 'Tuples and arrays in rust', 'summary': 'Covers tuples, which are groups of values and can have a maximum of 12 elements, and arrays, which have a fixed length and elements of the same data type, with an example of creating and accessing tuple and array elements and their printing.', 'duration': 279.532, 'highlights': ['Tuples group together values and can have a maximum of 12 elements. Tuples allow grouping of different types of values and have a maximum capacity of 12 elements.', "Creating a tuple called 'person' with string, string, and 8-bit number values and accessing them. Demonstrates the creation of a tuple named 'person' with string, string, and 8-bit number values, and accessing its elements to print 'Brad is from mass and is 37.'", 'Arrays have a fixed length and elements of the same data types, with an example of creating, printing, and modifying an array. Explains the concept of arrays with fixed length and elements of the same data types, including an example of creating, printing, and modifying an array.']}, {'end': 3299.7, 'start': 2957.13, 'title': 'Rust arrays and slices', 'summary': 'Explores working with arrays in rust, covering topics such as array size, data type, accessing single values, mutable arrays, array length, memory allocation, slicing, and utilizing the standard library. it also demonstrates memory allocation, showing that the array occupies 20 bytes and when reduced, occupies 16 bytes.', 'duration': 342.57, 'highlights': ['The chapter explores working with arrays in Rust, covering topics such as array size, data type, accessing single values, mutable arrays, array length, memory allocation, slicing, and utilizing the standard library. The chapter covers various aspects of working with arrays in Rust, including array size, data type, accessing single values, mutable arrays, array length, memory allocation, slicing, and utilizing the standard library.', 'It also demonstrates memory allocation, showing that the array occupies 20 bytes and when reduced, occupies 16 bytes. The demonstration showcases memory allocation, indicating that the array occupies 20 bytes and, upon reduction, occupies 16 bytes.']}, {'end': 3629.652, 'start': 3299.78, 'title': 'Vectors in rust', 'summary': 'Covers the concept of vectors in rust, emphasizing their resizable nature, methods for adding and removing elements, looping through values, and mutating each value, with an example of multiplying each value by two.', 'duration': 329.872, 'highlights': ["Vectors are resizable arrays and defined using the 'vec!' macro with the data type specified inside angle brackets, such as 'vec