Skip to content

Instantly share code, notes, and snippets.

View abusch's full-sized avatar

Antoine Büsch abusch

View GitHub Profile
@kyleheadley
kyleheadley / inherit.rs
Created January 4, 2018 03:21
A model for trait-based inheritance in Rust
//! Demo of static "inheritance"
//!
//! Use trait objects to get dynamic inheritance,
//! but casting to a subtype is not explored here
////////////////////////////////////////////////////////
// Define Base type, interface, and what is overloadable
////////////////////////////////////////////////////////
/// The main type that will be extended