pub struct Drawbar { /* private fields */ }Expand description
One drawbar, in the four-bit slot the Stage models give it.
Positions are physical, 0..=8. The slot holds four bits, so decoding is total: a
nibble above 8 is preserved and reported by Self::position as None rather than
refused, on the same rule as crate::types::RangedU8 — the bound is the slot’s, not
the instrument’s.
⚠️ The two constructors therefore disagree on purpose. Self::new takes a
position and refuses 9 and above; from_bits — and so set_field, which goes
through the type’s own parse — takes a nibble and accepts all sixteen, because a
file holding one has to round-trip. A caller offering a bar to a player wants the
former.
⚠️ On the Stage 2’s Farfisa the register is a tab, and the file stores a bit rather
than a nibble, so those fields are bool and not this type.
Implementations§
Trait Implementations§
impl Copy for Drawbar
impl Eq for Drawbar
Source§impl Ord for Drawbar
impl Ord for Drawbar
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl Packed for Drawbar
impl Packed for Drawbar
Source§const CONTROL: ControlKind
const CONTROL: ControlKind
Which bar of the register this is comes from the declaration site — every bar
shares this type — so #[bitbody] fills the rank in from a …_N field name.
Source§const MAX_BITS: u32 = 4
const MAX_BITS: u32 = 4
Source§const DECODE_BITS: u32 = u8::BITS
const DECODE_BITS: u32 = u8::BITS
Source§type Error = !
type Error = !
Infallible when every pattern is.Source§impl PartialOrd for Drawbar
impl PartialOrd for Drawbar
impl StructuralPartialEq for Drawbar
Auto Trait Implementations§
impl Freeze for Drawbar
impl RefUnwindSafe for Drawbar
impl Send for Drawbar
impl Sync for Drawbar
impl Unpin for Drawbar
impl UnsafeUnpin for Drawbar
impl UnwindSafe for Drawbar
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.