Guest User

Untitled

a guest
Dec 18th, 2018
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1. trait Element {
  2. fn get_id(&self) -> u128;
  3. }
  4.  
  5. struct Image {
  6. id: u128,
  7. }
  8.  
  9. #[allow(dead_code)]
  10. struct Video {
  11. id: u128,
  12. }
  13.  
  14.  
  15. impl Element for Image {
  16. fn get_id(&self) -> u128 {
  17. return self.id;
  18. }
  19. }
  20.  
  21. //impl Element for Video {}
  22.  
  23. // lot of more elements...
  24.  
  25. #[allow(unused_variables)]
  26. fn main() {
  27. let x = Image {id: 23};
  28.  
  29. }
Add Comment
Please, Sign In to add comment