Skip to main content

ControlledResistance

Trait ControlledResistance 

pub trait ControlledResistance: WdfLeaf {
    // Required methods
    fn set_control(&mut self, value: f64);
    fn effective_control(&self) -> f64;
}
Expand description

Element with externally-controlled resistance.

Photocouplers and similar devices where resistance varies based on an external control signal (LED current, etc.).

Required Methods§

fn set_control(&mut self, value: f64)

Set the control value (0.0 = minimum effect, 1.0 = maximum effect).

For photocouplers: 0 = dark (high R), 1 = full illumination (low R).

fn effective_control(&self) -> f64

Get the current effective control level (after any internal filtering).

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§