New Rustacean

e008: Just like something else

New Rustacean

Notes

In this episode we cover—at a very high level—two more fundamental concepts in Rust programming: generics and traits.

Generics gives us the abilitty to write types and functions which can be used with more than one type. Traits give us the ability to specify behavior which can be implemented for more than one type. The combination gives us powerful tools for higher-level programming constructs in Rust.

Comments on source code

Now that we have a handle on how tests work, we’ll use them to validate the behavior of our code going forward. This is great: we can show that the tests do what we think.

To today’s point, though: we actually know even apart from whether the tests run successfully that these generic functions and the associated traits are behaving as we want. Failure with generics is a compile-time error, not a runtime error.

Sponsors

  • Chris Palmer
  • Derek Morr
  • Luca Schmid
  • Micael Bergeron
  • Ralph Giles (“rillian”)
  • reddraggone9
  • William Roe

Become a sponsor

Follow

Next Episodes

New Rustacean

e007: Testify @ New Rustacean

📆 2015-12-13 18:38 / 00:18:46


New Rustacean

Bonus 2: Legacy Code @ New Rustacean

📆 2015-12-06 19:23 / 00:09:41


New Rustacean

Bonus 1: Polyglot Programming Promises and Perils @ New Rustacean

📆 2015-11-25 17:27 / 00:08:28


New Rustacean

e006: Modularize this! @ New Rustacean

📆 2015-11-16 16:36 / 00:18:22


New Rustacean

e005: Allocate it where? @ New Rustacean

📆 2015-11-08 21:15 / 00:18:30