Trait PulseCode

Source
pub trait PulseCode: Sealed {
    // Required methods
    fn new(level1: Level, length1: u16, level2: Level, length2: u16) -> Self;
    fn empty() -> Self;
    fn reset(&mut self);
    fn level1(&self) -> Level;
    fn length1(&self) -> u16;
    fn level2(&self) -> Level;
    fn length2(&self) -> u16;
}
Available on crate feature unstable only.
Expand description

Convenience trait to work with pulse codes.

Required Methods§

Source

fn new(level1: Level, length1: u16, level2: Level, length2: u16) -> Self

Create a new instance

Source

fn empty() -> Self

Create a new empty instance

Source

fn reset(&mut self)

Set all levels and lengths to 0

Source

fn level1(&self) -> Level

Logical output level in the first pulse code interval

Source

fn length1(&self) -> u16

Length of the first pulse code interval (in clock cycles)

Source

fn level2(&self) -> Level

Logical output level in the second pulse code interval

Source

fn length2(&self) -> u16

Length of the second pulse code interval (in clock cycles)

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.

Implementations on Foreign Types§

Source§

impl PulseCode for u32

Source§

fn new(level1: Level, length1: u16, level2: Level, length2: u16) -> Self

Source§

fn empty() -> Self

Source§

fn reset(&mut self)

Source§

fn level1(&self) -> Level

Source§

fn length1(&self) -> u16

Source§

fn level2(&self) -> Level

Source§

fn length2(&self) -> u16

Implementors§