A structure is a custom data type that lets you name and package together multiple related values that make up a meaningful group.
[Instructor] A struct or structure is a custom data type…that lets us name and package together…multiple rated values that make up a meaningful group.…If you're familiar with an object oriented language…a struct is like an object's data attributes.…The struct and enum concepts are the binding blocks…of creating new types in a programs domain…to take full advantage of Rust compile time type checking.…Structs are similar to tupual.…
Like tupuals, the pieces of a struct…can be of different types.…Let's create a new project and call it structs.…(typing)…Let's get into the project…(typing)…and on visual studio code…you should see the main.rs file created for you.…Let's remove the standard println statement.…Let's declare our first struct and call it user.…The struct goes inside the main function.…(typing)…The struct contains username and email…which is of string types.…
So let me say username followed by a colon.…And a string type which is then followed by a comma…and then the email of that particular user…which is also a string type.…
- Installing Rust
- Data types
- Adjusting memory allocation
- Setting up race conditions
- Working with functions
- Exploring references and borrowing
- Using structs
- Method syntax
- Demonstrating recoverable errors with Result
- Working with enums
- Getting user input
Skill Level Beginner
Programming Foundations: Data Structures (2014)with Simon Allardice2h 29m Intermediate
1. Hello, Rust!
2. Basic Programming Concepts
3. Ownership in Rust
4. Data Handling and Pattern Matching in Rust
5. Error Handling
6. Sample Rust Project: The Guessing Game
Next steps1m 14s
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.