Earlier quoted context omitted.
> As long as your final handle has the correct type Come on. Ensuring that is the whole game!
Yeah, and it's trivial in C++, what's your point? The example looks like it's been custom tailored to show how awesome Rust is, but then the post fails to even make the point (however contrived). Why the hell would you want to change the direction of a pin anyway? Just declare it as Pin or Pin .
I see lots of assertions of that fact, but no examples. Care to link some actual code?
> Why the hell would you want to change the direction of a pin anyway? Just declare it as Pin or Pin.
i2c uses the same pin for sending and receiving and changes the mode of the pin for the purposes of communication with peripherals.