Struct htu2xd::ResultReader[][src]

pub struct ResultReader<'h, I, M> { /* fields omitted */ }

A proxy used to read the result of a non-blocking measurement

Implementations

impl<'h, I, M> ResultReader<'h, I, M> where
    I: Read,
    M: Measurement
[src]

pub fn read_result<F>(
    &mut self,
    i2c: &mut I,
    is_nak: F
) -> Result<Reading<M>, Error<I::Error>> where
    F: FnOnce(&I::Error) -> bool, 
[src]

Attempts to read a measurement result from the sensor

is_nak must be a closure that returns true if the provided error is a NAK (negative acknowledge) error, or false otherwise.

This function returns Err(nb::Error::WouldBlock) if the sensor does not acknowledge its address. This means that it is still performing the measurement. This function should be called again later to try again.

On success, this function returns the sensor reading.

After this function returns anything other than Err(nb::Error::WouldBlock), this ResultReader must not be used again.

Auto Trait Implementations

impl<'h, I, M> Send for ResultReader<'h, I, M> where
    I: Send,
    M: Send

impl<'h, I, M> Sync for ResultReader<'h, I, M> where
    I: Sync,
    M: Sync

impl<'h, I, M> Unpin for ResultReader<'h, I, M> where
    M: Unpin

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.