e002: Something borrowed, something... moved?

Published: Oct. 12, 2015, 2:24 a.m.

b'

Something borrowed, something\\u2026 moved?

\\n

Subject: The struct data type constructor, and the basics of Rust\\u2019s \\u201cownership\\u201d concept and \\u201cborrowing\\u201d and \\u201cmoving\\u201d.

\\n

Follow/Support

\\n\\n

Notes

\\n

Today\\u2019s episode discusses, and the associated source code demonstrates, a few basic behaviors of structs\\u2026 including borrowing!

\\n

After taking a short look at one of Rust\\u2019s basic approaches to creating new types, we dive into a fairly thorough overview of how borrowing works in fairly run-of-the-mill Rust code. This is a basic introduction, and as such I\\u2019m not getting into things like heap-allocated memory (Box) or dealing with move semantics with threads or closures. (I haven\\u2019t actually figured those out well enough yet to write something like this for them!)

\\n

As usual, you\\u2019ll want to have the src open to see what I\\u2019m doing with the components documented below.

\\n

Links

\\n'