pub fn read_iter<'a, U>(
    &'a mut self,
    metric: Metric<U>,
    interval: Duration,
  ) -> MetricReadIterator<U>
  where
    U: MetrifulUnit
  {
    MetricReadIterator {
      device: self,
      error: false,
      timeout: None,
      last_instant: Instant::now(),
      metric,
      interval,
    }
  }
/// Returns an iterator that reads the given metric repeatedly at a given
/// interval. Note that the thread will block for `interval` duration on each
/// read. It reads indefinitely or until an error occurs.
///
/// Note that this iterator performs "on-demand" measurements and as such
/// certain metrics will not be available, particularly air quality data.
/// Consider using [`Metriful::cycle_read_iter_timeout()`] for these values.
///
/// Only a single "metric" may be read per iteration, however various
/// combined pseudo-metrics can be be used to read more data, including
/// [`struct@METRIC_COMBINED_ALL`].
///
/// This may block indefinitely if device communication fails; consider using
/// [`Metriful::read_iter_timeout()`] to specify a timeout.
///
/// See the [`MetricReadIterator`] documentation for further information.
///
/// # Example
/// ```no_run
/// use std::time::Duration;
/// use metriful::{Metriful, metric::*};
///
/// # fn main() -> metriful::error::Result<()> {
/// let mut metriful = Metriful::try_new(17, "/dev/i2c-1", 0x71)?;
///
/// for metric in metriful.read_iter(*METRIC_COMBINED_ALL, Duration::from_secs(3)) {
///   let metric = metric?;
///   println!("{}", metric);
/// }
/// # Ok(())
/// # }
/// ```
Returns an iterator that reads the given metric repeatedly at a given
interval. Note that the thread will block for `interval` duration on each
read. It reads indefinitely or until an error occurs.

Note that this iterator performs "on-demand" measurements and as such
certain metrics will not be available, particularly air quality data.
Consider using [`Metriful::cycle_read_iter_timeout()`] for these values.

Only a single "metric" may be read per iteration, however various
combined pseudo-metrics can be be used to read more data, including
[`struct@METRIC_COMBINED_ALL`].

This may block indefinitely if device communication fails; consider using
[`Metriful::read_iter_timeout()`] to specify a timeout.

See the [`MetricReadIterator`] documentation for further information.
Returns an iterator that reads the given metric repeatedly at a given interval . Note that the thread will block for ` interval ` duration on each read . It reads indefinitely or until an error occurs . Note that this iterator performs " on - demand " measurements and as such certain metrics will not be available particularly air quality data . Consider using [ ` Metriful :: cycle_read_iter_timeout () ` ] for these values . Only a single " metric " may be read per iteration however various combined pseudo - metrics can be be used to read more data including [ ` struct@METRIC_COMBINED_ALL ` ] . This may block indefinitely if device communication fails ; consider using [ ` Metriful :: read_iter_timeout () ` ] to specify a timeout . See the [ ` MetricReadIterator ` ] documentation for further information .
pub fn read_iter<'a, U>(
    &'a mut self,
    metric: Metric<U>,
    interval: Duration,
  ) -> MetricReadIterator<U>
  where
    U: MetrifulUnit
  {
    MetricReadIterator {
      device: self,
      error: false,
      timeout: None,
      last_instant: Instant::now(),
      metric,
      interval,
    }
  }
pub fn read_iter < ' a , U > ( & ' a mut self , metric : Metric < U > , interval : Duration , ) -> MetricReadIterator < U > where U : MetrifulUnit { MetricReadIterator { device : self , error : false , timeout : None , last_instant : Instant :: now ( ) , metric , interval , } }
Returns an iterator that reads the given metric repeatedly at a given
interval.
Returns an iterator that reads the given metric repeatedly at a given interval .
&'a mut self
metric
Metric<U>
interval
Duration
&'a mut self
metric
Metric<U>
interval
Duration
example
```no_run
use std::time::Duration;
use metriful::{Metriful, metric::*}.
` ` ` no_run use std :: time :: Duration ; use metriful :: { Metriful metric :: * } .
fn main() -> metriful::error::result<()> {
None
ok(())
None
}
None