pub struct Wire {
pub id: Uuid,
pub a: Point,
pub b: Point,
pub bends: Vec<Point>,
pub start: Option<Terminal>,
pub end: Option<Terminal>,
pub connection_id: String,
pub stock_part_number: String,
pub harness: bool,
}Fields§
§id: Uuid§a: Point§b: Point§bends: Vec<Point>§start: Option<Terminal>§end: Option<Terminal>§connection_id: StringWiring diagrams only: the connection’s identifier in the connection list.
stock_part_number: StringWiring diagrams only: stock part number of the wire or cable.
harness: boolOn a DocumentKind::Sheet only: a HARNESS wire, joining two pins point to
point, rather than a net. Never set on a schematic or a wiring diagram, whose
kind says it (Document::is_harness).
Implementations§
Source§impl Wire
impl Wire
pub fn new(a: Point, b: Point) -> Self
pub fn points(&self) -> Vec<Point>
pub fn set_points(&mut self, points: Vec<Point>)
Sourcepub fn slide_segment(&mut self, index: usize, delta: Point)
pub fn slide_segment(&mut self, index: usize, delta: Point)
Move a segment perpendicular to itself. Outer terminals remain fixed.
Sourcepub fn add_jog(&mut self, index: usize)
pub fn add_jog(&mut self, index: usize)
Insert an offset in the middle of the selected segment.
pub fn removable_jog(&self, near: usize) -> Option<usize>
pub fn remove_jog(&mut self, near: usize)
pub fn follow(&mut self, a: Point, b: Point)
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Wire
impl<'de> Deserialize<'de> for Wire
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl StructuralPartialEq for Wire
Auto Trait Implementations§
impl Forget for Wire
impl Freeze for Wire
impl Move for Wire
impl RefUnwindSafe for Wire
impl Send for Wire
impl Sync for Wire
impl Unpin for Wire
impl UnsafeUnpin for Wire
impl UnwindSafe for Wire
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
Mutably borrows from an owned value. Read more