#![allow(unused)]
#[macro_use]
extern crate qdowncast;
use qdowncast::QDowncastable;
use std::any::Any;
trait Store: Any {
type Id: Any;
}
impl<Id, T> QDowncastable<T> for Store<Id = Id>
where Id: Any, T: Store<Id = Id>
{
qdowncastable_items!(T);
}
impl<Id: Any> Store<Id = Id> {
qdowncast_method_items!();
}
pub struct MyStore;
impl Store for MyStore {
type Id = usize;
}
fn as_mystore<'a>(store: &'a Store<Id = usize>) -> Option<&'a MyStore> {
store.downcast_ref()
}