Advertisement
Guest User

Untitled

a guest
Nov 4th, 2018
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Rust 0.94 KB | None | 0 0
  1. pub struct AM2315<'a, P : 'a> where P : I2CDevice {
  2.     device: &'a P,
  3. }
  4.  
  5. impl<'a, P: 'a> AM2315<'a, P> where P: I2CDevice  {
  6.     pub fn new(device: &'a P) -> Self {
  7.        AM2315 {
  8.            device: device
  9.        }
  10.    }
  11. }
  12.  
  13. impl<'a, P: 'a> SensorModule for AM2315<'a, P> where P: I2CDevice {
  14.     fn get_name(&self) -> &'static str {
  15.        "AM2315 Temp/Hum Module"
  16.    }
  17.  
  18.    type Data = f32;
  19.    type Iter = Iterator<Item=(SystemTime, f32)>;
  20.    fn iter(&self) -> Self::Iter {  ///// This line is causing problems.
  21.            
  22.    }
  23. }
  24.  
  25. /// Problem:
  26. {
  27.     "resource": "/home/tball/Udvikling/git/home_surveillance/src/modules/temp.rs",
  28.     "owner": "rust",
  29.     "code": "E0277",
  30.     "severity": 8,
  31.     "message": "the size for values of type `(dyn std::iter::Iterator<Item=(std::time::SystemTime, f32)> + 'static)` cannot be known at compilation time",
  32.     "startLineNumber": 18,
  33.     "startColumn": 17,
  34.     "endLineNumber": 18,
  35.     "endColumn": 17
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement