You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// crate: facade// we define some facade interfaces herepubtraitGenericInterface:Any + Send + Sync;// or using nightly trait aliaspubtraitGenericInterface = Any + Send + Sync;pubtraitSomeInterface:GenericInterface;// crate: servicepubstructService{}implComponentforService{typeInterface = Box<dynGenericInterface>;
...
}// crate: application// we use shaku here to organize module and codeuse shaku::Interface;// but we can't using GenericInterface here because shaku::Interface only impl for those size type (T) not object trait.impl shaku::InterfacefordynGenericInterface{}
the Interface and other defs should be impl for trait object itself too.
// implement for all Timpl<T:Any + Send + Sync>InterfaceforT{}// implement for all trait objectimplInterfacefordynAny + Send + Sync{}
The text was updated successfully, but these errors were encountered:
the
Interface
and other defs should be impl for trait object itself too.The text was updated successfully, but these errors were encountered: