pub trait BaudrateExt {
// Required method
fn into_baudrate<CLOCK: Clock>(self) -> Baudrate<CLOCK>;
}
Expand description
Provide a into_baudrate()
method for integers.
This extension trait allows conveniently initializing a baudrate by using
let mut serial = arduino_uno::Serial::new(
dp.USART0,
pins.d0,
pins.d1.into_output(&mut pins.ddr),
57600.into_baudrate(),
);
instead of having to call Baudrate::new(57600)
.
Required Methods§
Sourcefn into_baudrate<CLOCK: Clock>(self) -> Baudrate<CLOCK>
fn into_baudrate<CLOCK: Clock>(self) -> Baudrate<CLOCK>
Calculate baudrate parameters from this number.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.