pub enum PortClass {
Conducting,
ControlInput,
Transducer(Domain),
Rail,
}Expand description
Device-agnostic classification of what a single port (a component.pin)
is, derived entirely from existing model facts — no new annotation.
Variants§
Conducting
An ordinary current-conducting terminal that gets MNA/WDF-stamped: a tube plate / cathode, BJT collector / emitter, R/C/L pins, op-amp output. The default for anything that is not a control / transducer / rail port.
ControlInput
A high-impedance signal-control electrode: tube grid, BJT base, FET
gate, op-amp inverting/non-inverting input. Derived from
SignalTerminals::Amplifier input/control.
Transducer(Domain)
A transducer port that couples across a non-electrical Domain
(photocoupler .led, OTA .iabc, VCA .cv, FET .vgs). Derived from
Component::modulation_sink.
Rail
A supply / ground / AC-ground rail node. Derived from the graph rail
sets. (A node property; from_component cannot see it, so it is
supplied by PortClass::from_pin_in_graph.)
Implementations§
Source§impl PortClass
impl PortClass
Sourcepub fn from_component(comp: &dyn Component, pin: &str) -> Self
pub fn from_component(comp: &dyn Component, pin: &str) -> Self
Derive the class of pin on comp from the device model alone.
This is the component-fact half of the derivation (it cannot see graph
nodes, so it never returns PortClass::Rail — use
PortClass::from_pin_in_graph for the rail-aware classification).
Precedence (most-specific first):
- A pin that is a
Component::modulation_sinkis a transducer port —.led,.iabc,.cv,.vgs. (A FET’svgs/gateIS a transducer port when read this way; that is the intended unification — the control electrode of an externally-modulated device is a transducer.) - A pin that is the
inputorcontrolof anSignalTerminals::Amplifieris aPortClass::ControlInput— grid / base / gate / op-amp pos+neg. - Otherwise
PortClass::Conducting.
Sourcepub fn from_pin_in_graph(
comp: &dyn Component,
pin: &str,
node: usize,
graph: &CircuitGraph,
) -> Self
pub fn from_pin_in_graph( comp: &dyn Component, pin: &str, node: usize, graph: &CircuitGraph, ) -> Self
Rail-aware classification of comp.pin resolved against graph.
Identical to PortClass::from_component except a pin whose resolved
node is a rail (gnd / vcc / named supply / AC-ground) returns
PortClass::Rail. The rail check takes precedence because a terminal
tied straight to a rail is electrically a rail port regardless of its
device role.
Trait Implementations§
impl Copy for PortClass
impl Eq for PortClass
impl StructuralPartialEq for PortClass
Auto Trait Implementations§
impl Freeze for PortClass
impl RefUnwindSafe for PortClass
impl Send for PortClass
impl Sync for PortClass
impl Unpin for PortClass
impl UnsafeUnpin for PortClass
impl UnwindSafe for PortClass
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.