fn pin_read_fn_factory(pin: Rc<LineState>) -> Box<dyn Fn() -> GpioPinValue> {
    Box::from(move || {
        LineState::switch_to_in(&pin);
        let res = pin.handle.borrow().as_ref().unwrap().get_value().unwrap();
        LineState::switch_to_out(&pin);
        return if res == 0 { GpioPinValue::LOW } else { GpioPinValue::HIGH }
    })
}
/// Creates a function/closure for the given pin that reads its value in the moment of invocation.
Creates a function/closure for the given pin that reads its value in the moment of invocation.
Creates a function / closure for the given pin that reads its value in the moment of invocation .
fn pin_read_fn_factory(pin: Rc<LineState>) -> Box<dyn Fn() -> GpioPinValue> {
    Box::from(move || {
        LineState::switch_to_in(&pin);
        let res = pin.handle.borrow().as_ref().unwrap().get_value().unwrap();
        LineState::switch_to_out(&pin);
        return if res == 0 { GpioPinValue::LOW } else { GpioPinValue::HIGH }
    })
}
fn pin_read_fn_factory ( pin : Rc < LineState > ) -> Box < dyn Fn ( ) -> GpioPinValue > { Box :: from ( move | | { LineState :: switch_to_in ( & pin ) ; let res = pin . handle . borrow ( ) . as_ref ( ) . unwrap ( ) . get_value ( ) . unwrap ( ) ; LineState :: switch_to_out ( & pin ) ; return if res == 0 { GpioPinValue :: LOW } else { GpioPinValue :: HIGH } } ) }
Creates a function/closure for the given pin that reads its value in the moment of invocation.
Creates a function / closure for the given pin that reads its value in the moment of invocation .
pin
Rc<LineState>