//! Quadrature-based index decoder.
/// A decoder for detecting the rising edge of the index signal (z channel).
////// ```plain
/// ┌─┐ high
/// Z │ │
/// ─ ─ ─ ──────┘ └────────────────── ─ ─ ─ low
/// ```
#[derive(Default, Debug)]pub(crate)structIndexDecoder{z:bool,
}implIndexDecoder{/// Resets the decoder to the default state
pubfnreset(&mutself){self.z =false;}/// Updates the internal state and returns `true` iff it
/// detects a raising edge on the z channel, otherwise `false`.
pubfnupdate(&mutself, z:bool)->bool{let is_at_edge =self.z != z;self.z = z;
z && is_at_edge
}}