Guest User

Untitled

a guest
Jan 16th, 2019
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. trait Backend {
  2. fn backend() {
  3. println!("I am a backend!");
  4. }
  5. }
  6.  
  7. trait SupportsType<Other> {
  8. fn convert_type() {
  9. println!("I can convert this type!");
  10. }
  11. }
  12.  
  13. mod A {
  14. use super::*;
  15. pub struct BackendA;
  16.  
  17. impl Backend for BackendA {}
  18. impl SupportsType<BackendA> for *const str {}
  19. }
  20.  
  21. mod B {
  22. use super::*;
  23. pub struct BackendB;
  24.  
  25. impl Backend for BackendB {}
  26. impl SupportsType<BackendB> for *const str {}
  27. }
  28.  
  29. impl<Back: Backend> SupportsType<Back> for *const str {}
  30.  
  31. fn main() {
  32. }
Add Comment
Please, Sign In to add comment