pub struct RepeatDisplayOptions<'d, const N: usize, T, CLK, DIO, DELAY, I, D> { /* private fields */ }
Expand description
High-level API for repeat animations.
Display all bytes of the given iterator on the same position.
§Example
Repeat the string “HELLO” on the display.
use tm1637_embedded_hal::{mock::Noop, TM1637Builder};
let mut tm = TM1637Builder::new(Noop, Noop, Noop).build_blocking::<4>();
tm.options().str("HELLO").repeat().finish().run();
The display will show:
+---+ +---+ +---+ +---+
| H | | | | | | |
+---+ +---+ +---+ +---+
+---+ +---+ +---+ +---+
| E | | | | | | |
+---+ +---+ +---+ +---+
+---+ +---+ +---+ +---+
| L | | | | | | |
+---+ +---+ +---+ +---+
+---+ +---+ +---+ +---+
| L | | | | | | |
+---+ +---+ +---+ +---+
+---+ +---+ +---+ +---+
| O | | | | | | |
+---+ +---+ +---+ +---+
Implementations§
Source§impl<'d, const N: usize, T, CLK, DIO, DELAY, I, M> RepeatDisplayOptions<'d, N, T, CLK, DIO, DELAY, I, M>
impl<'d, const N: usize, T, CLK, DIO, DELAY, I, M> RepeatDisplayOptions<'d, N, T, CLK, DIO, DELAY, I, M>
Sourcepub fn new(
options: DisplayOptions<'d, N, T, CLK, DIO, DELAY, I, M>,
delay_ms: u32,
) -> Self
pub fn new( options: DisplayOptions<'d, N, T, CLK, DIO, DELAY, I, M>, delay_ms: u32, ) -> Self
Create a new RepeatDisplayOptions
instance.
Sourcepub fn new_with_defaults(
options: DisplayOptions<'d, N, T, CLK, DIO, DELAY, I, M>,
) -> Self
pub fn new_with_defaults( options: DisplayOptions<'d, N, T, CLK, DIO, DELAY, I, M>, ) -> Self
Create a new RepeatDisplayOptions
instance with default settings.
Sourcepub const fn delay_ms(self, delay_ms: u32) -> Self
pub const fn delay_ms(self, delay_ms: u32) -> Self
Set the delay in milliseconds between each animation step.
Sourcepub fn finish(
self,
) -> Scroller<'d, N, T, CLK, DIO, DELAY, impl Iterator<Item = impl DoubleEndedIterator<Item = u8> + ExactSizeIterator>, M>
pub fn finish( self, ) -> Scroller<'d, N, T, CLK, DIO, DELAY, impl Iterator<Item = impl DoubleEndedIterator<Item = u8> + ExactSizeIterator>, M>
Finish setting the repeat animation.
Trait Implementations§
Auto Trait Implementations§
impl<'d, const N: usize, T, CLK, DIO, DELAY, I, D> Freeze for RepeatDisplayOptions<'d, N, T, CLK, DIO, DELAY, I, D>
impl<'d, const N: usize, T, CLK, DIO, DELAY, I, D> RefUnwindSafe for RepeatDisplayOptions<'d, N, T, CLK, DIO, DELAY, I, D>where
I: RefUnwindSafe,
D: RefUnwindSafe,
CLK: RefUnwindSafe,
DIO: RefUnwindSafe,
DELAY: RefUnwindSafe,
T: RefUnwindSafe,
impl<'d, const N: usize, T, CLK, DIO, DELAY, I, D> Send for RepeatDisplayOptions<'d, N, T, CLK, DIO, DELAY, I, D>
impl<'d, const N: usize, T, CLK, DIO, DELAY, I, D> Sync for RepeatDisplayOptions<'d, N, T, CLK, DIO, DELAY, I, D>
impl<'d, const N: usize, T, CLK, DIO, DELAY, I, D> Unpin for RepeatDisplayOptions<'d, N, T, CLK, DIO, DELAY, I, D>
impl<'d, const N: usize, T, CLK, DIO, DELAY, I, D> !UnwindSafe for RepeatDisplayOptions<'d, N, T, CLK, DIO, DELAY, I, D>
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