Skip to main content

Pin

Struct Pin 

Source
pub struct Pin {
    pub hidden: bool,
    pub unit: u32,
    pub gate: u32,
    pub number: String,
    pub name: String,
    pub alternates: Vec<String>,
    pub electrical_type: String,
    pub at: Point,
    pub end: Point,
}

Fields§

§hidden: bool§unit: u32

The symbol UNIT this pin belongs to, 1-based, as KiCad tags one. 0 means unassigned and reads as unit 1. A BREP part maps one unit to one port group, so this is what says which connector a pin is on (BREP_kernel/src/feature_pipeline/part_pins.rs).

Omitted when unset, so a SINGLE-UNIT symbol serializes exactly as it did before units existed. The editor compares its held symbol against the document’s block byte for byte to know whether it is in step, and a field that always wrote itself would put every stored symbol out of step until it was saved again.

§gate: u32

The GATE this pin is drawn with, 1-based: one of the separately placed sections of a device, such as the two amplifiers and the power section of a dual op-amp (KiCad calls them units and a sheet names them U1A, U1B, …). 0 means the symbol is not split into gates.

A gate is a DRAWING matter only. Every gate of a device is one package, one footprint and one port group, and a pin still binds by its number. That is what keeps it apart from Pin::unit, which says which port GROUP (which connector) a pin is on: the LM358’s pin 5 is on gate B and in the same group as pin 1. Omitted when unset, for the reason unit is.

§number: String§name: String

The pin’s main name (PA1).

§alternates: Vec<String>

The other functions the pin can serve (I2C1_SDA, USART2_RTS), as KiCad’s (alternate …) lists them. Each placed component chooses one of these, or the main name, for each pin (Component::pin_functions). The choice is DOCUMENTARY: it is the name the sheet prints, and nothing electrical reads it — nets, ERC and the netlist keep binding by number and reading the main name and type. Omitted when empty, for the reason unit is.

§electrical_type: String§at: Point§end: Point

Trait Implementations§

Source§

impl Clone for Pin

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 Pin

Source§

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

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

impl<'de> Deserialize<'de> for Pin

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl PartialEq for Pin

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 Serialize for Pin

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for Pin

Auto Trait Implementations§

§

impl Forget for Pin

§

impl Freeze for Pin

§

impl Move for Pin

§

impl RefUnwindSafe for Pin

§

impl Send for Pin

§

impl Sync for Pin

§

impl Unpin for Pin

§

impl UnsafeUnpin for Pin

§

impl UnwindSafe for Pin

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> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

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.