pub struct BuildOptions {
pub unsupported_elements: UnsupportedElementPolicy,
pub switch_states: BTreeMap<String, SwitchState>,
pub on_resistance: Expression,
pub off_resistance: Expression,
pub annotation_fields: BTreeSet<String>,
}Expand description
Options controlling matrix construction.
Fields§
§unsupported_elements: UnsupportedElementPolicyHandling of nonlinear or otherwise unstamped devices.
switch_states: BTreeMap<String, SwitchState>Case-insensitive element-name to switch state mapping.
on_resistance: ExpressionResistance used for switches in the on state.
off_resistance: ExpressionResistance used for switches in the off state.
annotation_fields: BTreeSet<String>Field names the caller owns, accepted on any device card, carried through to
MnaSystem::annotations verbatim and never stamped.
Empty by default, which is exactly today’s behaviour: an unregistered key=value
token is still rejected by [validate_trailing_fields], with the same message. A
registered name is accepted on every device letter, because the thing being
annotated is the component, not a particular stamp.
Registration rather than a list of known rating names: i_max is a current limit to
a converter simulator and would be something else to the next consumer, so a name
baked in here would make a stamping library the owner of someone else’s vocabulary,
and every new annotation would need a release of this crate before a netlist could
use it. Names are compared case-insensitively, like every other field.
Implementations§
Source§impl BuildOptions
impl BuildOptions
Sourcepub fn set_switch(
&mut self,
element_name: impl Into<String>,
state: SwitchState,
)
pub fn set_switch( &mut self, element_name: impl Into<String>, state: SwitchState, )
Adds or replaces a case-insensitive switch-state override.
Sourcepub fn annotate(&mut self, field: impl AsRef<str>)
pub fn annotate(&mut self, field: impl AsRef<str>)
Registers a field name this crate will accept on any device card and hand back
through MnaSystem::annotations without interpreting it.