pub enum BuzzerDecision {
Silent,
Rest {
next_deadline_ms: u64,
},
Tone {
frequency_hz: u16,
next_deadline_ms: u64,
},
}Expand description
State to apply to the buzzer driver right now.
Variants§
Silent
No tone; driver should disable the buzzer.
Rest
A rest inside a melody that is still playing: no tone, but the
sequence continues at next_deadline_ms.
Distinct from Silent because a driver that
powers its sounder down between notes pays a warm-up to bring it
back, and a warm-up that rewinds the melody turns every rest into
a loop. A driver with nothing to warm up may treat the two alike.
Tone
Drive a tone at frequency_hz. Re-invoke BuzzerEngine::tick
at next_deadline_ms to advance to the next note.
Trait Implementations§
Source§impl Clone for BuzzerDecision
impl Clone for BuzzerDecision
Source§fn clone(&self) -> BuzzerDecision
fn clone(&self) -> BuzzerDecision
Returns a duplicate of the value. Read more
1.0.0§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for BuzzerDecision
impl Debug for BuzzerDecision
Source§impl PartialEq for BuzzerDecision
impl PartialEq for BuzzerDecision
impl Copy for BuzzerDecision
impl Eq for BuzzerDecision
impl StructuralPartialEq for BuzzerDecision
Auto Trait Implementations§
impl Freeze for BuzzerDecision
impl RefUnwindSafe for BuzzerDecision
impl Send for BuzzerDecision
impl Sync for BuzzerDecision
impl Unpin for BuzzerDecision
impl UnwindSafe for BuzzerDecision
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)