pub struct Connector {Show 14 fields
pub connector_type: ConnectorType,
pub start_x: u32,
pub start_y: u32,
pub end_x: u32,
pub end_y: u32,
pub line: ConnectorLine,
pub start_arrow: ArrowType,
pub end_arrow: ArrowType,
pub arrow_size: ArrowSize,
pub start_shape_id: Option<u32>,
pub start_site: Option<ConnectionSite>,
pub end_shape_id: Option<u32>,
pub end_site: Option<ConnectionSite>,
pub label: Option<String>,
}Expand description
Connector definition
Fields§
§connector_type: ConnectorTypeConnector type
start_x: u32Start X position in EMU
start_y: u32Start Y position in EMU
end_x: u32End X position in EMU
end_y: u32End Y position in EMU
line: ConnectorLineLine style
start_arrow: ArrowTypeStart arrow
end_arrow: ArrowTypeEnd arrow
arrow_size: ArrowSizeArrow size
start_shape_id: Option<u32>Connected shape ID at start (optional)
start_site: Option<ConnectionSite>Connection site at start shape
end_shape_id: Option<u32>Connected shape ID at end (optional)
end_site: Option<ConnectionSite>Connection site at end shape
label: Option<String>Optional label text
Implementations§
Source§impl Connector
impl Connector
Sourcepub fn new(
connector_type: ConnectorType,
start_x: u32,
start_y: u32,
end_x: u32,
end_y: u32,
) -> Self
pub fn new( connector_type: ConnectorType, start_x: u32, start_y: u32, end_x: u32, end_y: u32, ) -> Self
Create a new connector
Sourcepub fn straight(start_x: u32, start_y: u32, end_x: u32, end_y: u32) -> Self
pub fn straight(start_x: u32, start_y: u32, end_x: u32, end_y: u32) -> Self
Create a straight connector
Sourcepub fn elbow(start_x: u32, start_y: u32, end_x: u32, end_y: u32) -> Self
pub fn elbow(start_x: u32, start_y: u32, end_x: u32, end_y: u32) -> Self
Create an elbow connector
Sourcepub fn curved(start_x: u32, start_y: u32, end_x: u32, end_y: u32) -> Self
pub fn curved(start_x: u32, start_y: u32, end_x: u32, end_y: u32) -> Self
Create a curved connector
Sourcepub fn with_line(self, line: ConnectorLine) -> Self
pub fn with_line(self, line: ConnectorLine) -> Self
Set line style
Sourcepub fn with_color(self, color: &str) -> Self
pub fn with_color(self, color: &str) -> Self
Set line color
Sourcepub fn with_width(self, width: u32) -> Self
pub fn with_width(self, width: u32) -> Self
Set line width in EMU
Sourcepub fn with_start_arrow(self, arrow: ArrowType) -> Self
pub fn with_start_arrow(self, arrow: ArrowType) -> Self
Set start arrow
Sourcepub fn with_end_arrow(self, arrow: ArrowType) -> Self
pub fn with_end_arrow(self, arrow: ArrowType) -> Self
Set end arrow
Sourcepub fn with_arrows(self, start: ArrowType, end: ArrowType) -> Self
pub fn with_arrows(self, start: ArrowType, end: ArrowType) -> Self
Set both arrows
Sourcepub fn with_arrow_size(self, size: ArrowSize) -> Self
pub fn with_arrow_size(self, size: ArrowSize) -> Self
Set arrow size
Sourcepub fn connect_start(self, shape_id: u32, site: ConnectionSite) -> Self
pub fn connect_start(self, shape_id: u32, site: ConnectionSite) -> Self
Connect to start shape
Sourcepub fn connect_end(self, shape_id: u32, site: ConnectionSite) -> Self
pub fn connect_end(self, shape_id: u32, site: ConnectionSite) -> Self
Connect to end shape
Sourcepub fn with_label(self, label: &str) -> Self
pub fn with_label(self, label: &str) -> Self
Add label text
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Connector
impl RefUnwindSafe for Connector
impl Send for Connector
impl Sync for Connector
impl Unpin for Connector
impl UnsafeUnpin for Connector
impl UnwindSafe for Connector
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