Traits
Rust-like traits.
Design
Definition
trait Foo {
fn bar() uint;
fn baz() {
// snip
}
}
Implementation
struct MyType;
impl Foo for MyType {
// notice how there is no type in impl block
fn bar() {
// chosen by a fair roll of dice
4
}
}