Struct apigpio::GpioChange
source · pub struct GpioChange {
pub pin: PPin,
pub level: Option<Level>,
pub tick: Option<Tick>,
pub sequence: Word,
}
Expand description
Represents a change to a gpio pin, as requested by
notify_subscribe
.
Fields
pin: PPin
BCM pin number.
level: Option<Level>
Can be None
only if notify_subscribe
parameter
read_initially
is false
: then it is None
before gpio has
been read for the first time. In that case, the first recv on
the Subscription
will get None
. All other recvs will get
Some
.
tick: Option<Tick>
None
until the first change. I.e., the first value observed on
Subscription
is None
(regardless of read_initially
)
and subsequent ones will get Some
.
sequence: Word
Increments by 1 each time the Subscription
is updated. This
allows you to spot missed updates, provided that you
look often enough that it doesn’t wrap.
Trait Implementations
sourceimpl Clone for GpioChange
impl Clone for GpioChange
sourcefn clone(&self) -> GpioChange
fn clone(&self) -> GpioChange
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresourceimpl Debug for GpioChange
impl Debug for GpioChange
sourceimpl Hash for GpioChange
impl Hash for GpioChange
sourceimpl PartialEq<GpioChange> for GpioChange
impl PartialEq<GpioChange> for GpioChange
sourcefn eq(&self, other: &GpioChange) -> bool
fn eq(&self, other: &GpioChange) -> bool
impl Copy for GpioChange
impl Eq for GpioChange
impl StructuralEq for GpioChange
impl StructuralPartialEq for GpioChange
Auto Trait Implementations
impl RefUnwindSafe for GpioChange
impl Send for GpioChange
impl Sync for GpioChange
impl Unpin for GpioChange
impl UnwindSafe for GpioChange
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more