e008: Just like something else

Published: Dec. 27, 2015, 4:19 p.m.

b'

Notes

\\n

In this episode we cover\\u2014at a very high level\\u2014two more fundamental concepts in Rust programming: generics and traits.

\\n

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.

\\n

Comments on source code

\\n

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

\\n

To today\\u2019s 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.

\\n\\n\\n

Sponsors

\\n
    \\n
  • Chris Palmer
  • \\n
  • Derek Morr
  • \\n
  • Luca Schmid
  • \\n
  • Micael Bergeron
  • \\n
  • Ralph Giles (\\u201crillian\\u201d)
  • \\n
  • reddraggone9
  • \\n
  • William Roe
  • \\n
\\n

Become a sponsor

\\n\\n

Follow

\\n'