Skip to main content

ElementOverlay

Struct ElementOverlay 

Source
pub struct ElementOverlay {
    pub refdes: String,
    pub shapes: Range<usize>,
    pub pins: Vec<PinOverlay>,
    pub value: Option<ValueSpanOverlay>,
    pub params: Vec<ParamSpanOverlay>,
    pub principal: Option<String>,
}
Expand description

One element’s shapes in the compiled drawing (ids sN of the SVG).

Fields§

§refdes: String§shapes: Range<usize>

Half-open range of shape indices of the element’s block.

§pins: Vec<PinOverlay>

The element’s terminals, in card order (the nodes of its card); empty for a K, which has none.

§value: Option<ValueSpanOverlay>

Where the element’s value/model argument is in the user’s source — the text an editor replaces to write a new value back (issue #17).

Some only when the card’s value is that argument of a call to one of the prelude’s own element macros (R1: resistor(A, B, 1k)), written in the user’s figure. None when there is none to point at: an element without a value argument (vsource(A, B)), a K (coupling(L1, L2, k) spreads its card over three arguments), an inline block, and every element whose outermost call is a user wrapper macro — the value then comes from the drawn fallback or from a wrapper argument, and neither is a span an edit can be trusted to land in. A display text (the argument after the value) never changes this: the span stays the value’s.

§params: Vec<ParamSpanOverlay>

The alterable parameters spelled inside Self::value, in source order, named as alter(refdes, param, …) names them (dune_core::Circuit::alter): for V/I sources dc, acmag, acphase (each the span of its number only: AC 1 90 gives acmag = 1 and acphase = 90) and the transient functions pulse, sin, exp, pwl, sffm, trnoise, trrandom (each the whole spelling, keyword and parentheses included: PULSE(0 5 0 1u 1u 10m 20m)); for R/C/L/E/G the principal value (the leading number) and ic (IC=…, C/L); gain of an F/H (Vname gain); area (the number after the model, or AREA=) and temp (TEMP=) of a D/Q/J; area of a Z; w, l, temp (W=…) of an M. Only what is spelled is listed (a source with no DC field has no dc entry), and a parameter spelled twice is listed once, at its last spelling (the one SPICE keeps). Empty when Self::value is None.

§principal: Option<String>

The parameter alter(refdes, value) (empty parameter name) changes for this element’s letter: resistance, capacitance, inductance, dc (V/I), gain (E/F/G/H), area (D/Q/J/Z); None for letters alter has no principal for (M, S, W, X, T, O, K). Independent of Self::value.

Implementations§

Source§

impl ElementOverlay

Source

pub fn ids(&self) -> String

The range as rpic object ids, "sN..sM" (inclusive).

Trait Implementations§

Source§

impl Clone for ElementOverlay

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ElementOverlay

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PartialEq for ElementOverlay

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for ElementOverlay

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.