tm1637_embedded_hal::options

Struct RepeatDisplayOptions

Source
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>

Source

pub fn new( options: DisplayOptions<'d, N, T, CLK, DIO, DELAY, I, M>, delay_ms: u32, ) -> Self

Create a new RepeatDisplayOptions instance.

Source

pub fn new_with_defaults( options: DisplayOptions<'d, N, T, CLK, DIO, DELAY, I, M>, ) -> Self

Create a new RepeatDisplayOptions instance with default settings.

Source

pub const fn delay_ms(self, delay_ms: u32) -> Self

Set the delay in milliseconds between each animation step.

Source

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§

Source§

impl<'d, const N: usize, T: Debug, CLK: Debug, DIO: Debug, DELAY: Debug, I: Debug, D: Debug> Debug for RepeatDisplayOptions<'d, N, T, CLK, DIO, DELAY, I, D>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'d, const N: usize, T, CLK, DIO, DELAY, I, D> Format for RepeatDisplayOptions<'d, N, T, CLK, DIO, DELAY, I, D>
where DisplayOptions<'d, N, T, CLK, DIO, DELAY, I, D>: Format,

Source§

fn format(&self, f: Formatter<'_>)

Writes the defmt representation of self to fmt.

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>
where I: Freeze, D: Freeze,

§

impl<'d, const N: usize, T, CLK, DIO, DELAY, I, D> RefUnwindSafe for RepeatDisplayOptions<'d, N, T, CLK, DIO, DELAY, I, D>

§

impl<'d, const N: usize, T, CLK, DIO, DELAY, I, D> Send for RepeatDisplayOptions<'d, N, T, CLK, DIO, DELAY, I, D>
where I: Send, D: Send, CLK: Send, DIO: Send, DELAY: Send, T: Send,

§

impl<'d, const N: usize, T, CLK, DIO, DELAY, I, D> Sync for RepeatDisplayOptions<'d, N, T, CLK, DIO, DELAY, I, D>
where I: Sync, D: Sync, CLK: Sync, DIO: Sync, DELAY: Sync, T: Sync,

§

impl<'d, const N: usize, T, CLK, DIO, DELAY, I, D> Unpin for RepeatDisplayOptions<'d, N, T, CLK, DIO, DELAY, I, D>
where I: Unpin, D: Unpin,

§

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.