1use std::rc::Rc;
2
3pub trait Component<T> {
4 fn get_component(&self) -> Rc<T>;
5}
6
7pub trait Entity {
8 fn get<T>(&self) -> Rc<T> where Self: Component<T>;
9}
10
11impl<E: ?Sized> Entity for E {
12 fn get<T>(&self) -> Rc<T> where Self: Component<T> {Component::<T>::get_component(self)}
13}