Skip to main content

PcbDocComponent

Struct PcbDocComponent 

Source
pub struct PcbDocComponent {
    pub designator: String,
    pub pattern: String,
    pub comment: String,
    pub params: ParameterCollection,
    pub primitives: Vec<PcbRecord>,
}
Expand description

A component placed on the board.

Fields§

§designator: String

Component designator (e.g., “R1”, “U1”).

§pattern: String

Footprint pattern name.

§comment: String

Component comment/value.

§params: ParameterCollection

Component parameters.

§primitives: Vec<PcbRecord>

Primitives belonging to this component.

Implementations§

Source§

impl PcbDocComponent

Source

pub fn x(&self) -> Option<Coord>

Get the X position of the component.

Source

pub fn y(&self) -> Option<Coord>

Get the Y position of the component.

Source

pub fn rotation(&self) -> f64

Get the rotation angle in degrees.

Source

pub fn layer(&self) -> Layer

Get the layer.

Source

pub fn set_x(&mut self, x: Coord)

Set the X position of the component.

Source

pub fn set_y(&mut self, y: Coord)

Set the Y position of the component.

Source

pub fn set_position(&mut self, x: Coord, y: Coord)

Set the position of the component.

Source

pub fn set_rotation(&mut self, rotation: f64)

Set the rotation angle in degrees.

Source

pub fn set_layer(&mut self, layer: Layer)

Set the layer.

Trait Implementations§

Source§

impl Debug for PcbDocComponent

Source§

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

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

impl Default for PcbDocComponent

Source§

fn default() -> PcbDocComponent

Returns the “default value” for a type. Read more
Source§

impl DumpTree for PcbDocComponent

Source§

fn dump(&self, tree: &mut TreeBuilder)

Dump this item to the tree builder.
Source§

fn dump_to_string(&self) -> String

Convenience method to dump to a string.
Source§

fn dump_to_string_with_options(&self, options: DumpOptions) -> String

Convenience method to dump to a string with options.

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> 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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

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

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.
Source§

impl<G1, G2> Within<G2> for G1
where G2: Contains<G1>,

Source§

fn is_within(&self, b: &G2) -> bool