pub struct ClockDisplayOptions<'d, const N: usize, T, CLK, DIO, DELAY, I, M> { /* private fields */ }
Expand description
High-level API for setting a clock.
§Example
Display the time 14:28
on the display.
use tm1637_embedded_hal::{mock::Noop, TM1637Builder};
let mut tm = TM1637Builder::new(Noop, Noop, Noop).build_blocking::<4>();
tm.options()
.clock()
.hour(14)
.minute(28)
.finish()
// Set the colon between the hours and minutes.
.dot(1)
.display()
.ok();
The display will show:
+---+ +---+ +---+ +---+
| 1 | | 4 |:| 2 | | 8 |
+---+ +---+ +---+ +---+
Implementations§
Source§impl<'d, const N: usize, T, CLK, DIO, DELAY, I, M> ClockDisplayOptions<'d, N, T, CLK, DIO, DELAY, I, M>
impl<'d, const N: usize, T, CLK, DIO, DELAY, I, M> ClockDisplayOptions<'d, N, T, CLK, DIO, DELAY, I, M>
Sourcepub fn new(options: DisplayOptions<'d, N, T, CLK, DIO, DELAY, I, M>) -> Self
pub fn new(options: DisplayOptions<'d, N, T, CLK, DIO, DELAY, I, M>) -> Self
Create a new ClockDisplayOptions
instance.
Sourcepub fn finish(
self,
) -> DisplayOptions<'d, N, T, CLK, DIO, DELAY, impl DoubleEndedIterator<Item = u8> + ExactSizeIterator, M>
pub fn finish( self, ) -> DisplayOptions<'d, N, T, CLK, DIO, DELAY, impl DoubleEndedIterator<Item = u8> + ExactSizeIterator, M>
Finish setting the clock.
Trait Implementations§
Auto Trait Implementations§
impl<'d, const N: usize, T, CLK, DIO, DELAY, I, M> Freeze for ClockDisplayOptions<'d, N, T, CLK, DIO, DELAY, I, M>
impl<'d, const N: usize, T, CLK, DIO, DELAY, I, M> RefUnwindSafe for ClockDisplayOptions<'d, N, T, CLK, DIO, DELAY, I, M>where
I: RefUnwindSafe,
M: RefUnwindSafe,
CLK: RefUnwindSafe,
DIO: RefUnwindSafe,
DELAY: RefUnwindSafe,
T: RefUnwindSafe,
impl<'d, const N: usize, T, CLK, DIO, DELAY, I, M> Send for ClockDisplayOptions<'d, N, T, CLK, DIO, DELAY, I, M>
impl<'d, const N: usize, T, CLK, DIO, DELAY, I, M> Sync for ClockDisplayOptions<'d, N, T, CLK, DIO, DELAY, I, M>
impl<'d, const N: usize, T, CLK, DIO, DELAY, I, M> Unpin for ClockDisplayOptions<'d, N, T, CLK, DIO, DELAY, I, M>
impl<'d, const N: usize, T, CLK, DIO, DELAY, I, M> !UnwindSafe for ClockDisplayOptions<'d, N, T, CLK, DIO, DELAY, I, M>
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