Skip to main content

Part

Trait Part 

Source
pub trait Part {
    // Required methods
    fn pin_changed(&mut self, pin: PinId, level: Level, now: Tick);
    fn drive(&self, pin: PinId) -> Level;

    // Provided methods
    fn next_tick(&self) -> Option<Tick> { ... }
    fn tick(&mut self, _now: Tick) { ... }
}
Expand description

A schematic component. Parts never read MCU registers; they react to pin levels and to time, which is the same contract a real part has.

Required Methods§

Source

fn pin_changed(&mut self, pin: PinId, level: Level, now: Tick)

Called for every level change on a pin this part is attached to.

Source

fn drive(&self, pin: PinId) -> Level

The level this part drives back onto a net, if any.

Provided Methods§

Source

fn next_tick(&self) -> Option<Tick>

Earliest tick at which this part wants Part::tick called again.

Source

fn tick(&mut self, _now: Tick)

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§