Open danielhenrymantilla opened 5 years ago
One of the greatest usages would be to have a correct abstraction over trait objects:
struct TraitObject<trait Trait> { ptr: *mut (), vtable: *const Trait::VTable, }
with a compiler defined type VTable defined for all traits.
type VTable
With my WIP crate https://docs.rs/inheritance, what the proc-macro generates for the trait that we want to inherit from (e.g., Point), is a new trait
Point
trait InheritsPoint { type Parent : Point; // projections from Self to Self::Parent }
Instead, having
trait Inherits<trait Trait> { type Parent : Trait; // projections from Self to Self::Parent }
as in the Map example from the README.md would make this cleaner.
Map
README.md
One of the greatest usages would be to have a correct abstraction over trait objects:
with a compiler defined
type VTable
defined for all traits.With my WIP crate https://docs.rs/inheritance, what the proc-macro generates for the trait that we want to inherit from (e.g.,
Point
), is a new traitInstead, having
as in the
Map
example from theREADME.md
would make this cleaner.(Post-it note for @Centril )