pub struct Loop { /* private fields */ }Expand description
Provides a constant-period looping construct.
Implementations§
Source§impl Loop
impl Loop
Sourcepub fn cycle(&self) -> usize
pub fn cycle(&self) -> usize
Returns the current cycle index.
This is initially 0 and increments each cycle (i.e., when
delay() returns or select successfully
completes).
Sourcepub fn is_mod(&self, modulus: usize) -> bool
pub fn is_mod(&self, modulus: usize) -> bool
Helper function to check whether the cycle index (see
cycle()) is a multiple of modulus.
Sourcepub fn select(&mut self) -> impl Selectable + '_
pub fn select(&mut self) -> impl Selectable + '_
A Selectable event which occurs at the next loop cycle.
Auto Trait Implementations§
impl Freeze for Loop
impl RefUnwindSafe for Loop
impl Send for Loop
impl Sync for Loop
impl Unpin for Loop
impl UnwindSafe for Loop
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
Mutably borrows from an owned value. Read more