Guest User

Untitled

a guest
May 24th, 2018
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. struct Manufacturer<'a>
  2. {
  3. name: &'a str
  4. }
  5.  
  6. struct Date<'a>
  7. {
  8. //YYYYMMDD
  9. value: &'a str
  10. }
  11.  
  12. trait product {
  13. fn get_manufacturer<'a>(&self) -> Manufacturer<'a>
  14. {
  15. self.manufacturer
  16. }
  17. fn get_release_date<'a>(&self) -> Date<'a>
  18. {
  19. self.release_date
  20. }
  21. fn get_model<'a>(&self) -> &'a str
  22. {
  23. self.model
  24. }
  25. }
  26.  
  27.  
  28. struct Hardware<'a>
  29. {
  30. manufacturer: Manufacturer<'a>,
  31. release_date: Date<'a>,
  32. model: &'a str
  33. }
  34.  
  35. impl <'a> product for Hardware<'a>
  36. {
  37. }
  38.  
  39. struct Software<'a>
  40. {
  41. manufacturer: Manufacturer<'a>,
  42. release_date: Date<'a>,
  43. model: &'a str
  44. }
  45.  
  46. impl <'a> product for Software<'a>
  47. {
  48. }
  49.  
  50. struct System<'a>
  51. {
  52. hardarray: Vec<Hardware<'a>>,
  53. softarray: Vec<Software<'a>>
  54. }
  55.  
  56. fn main()
  57. {
  58. }
Add Comment
Please, Sign In to add comment