pub struct PinInfo {
pub shape: Option<PinShape>,
pub fill: Option<Color32>,
pub stroke: Option<Stroke>,
pub wire_color: Option<Color32>,
pub wire_style: Option<WireStyle>,
pub position: Option<f32>,
}Expand description
Information about a pin returned by TreeizeViewer::show_input and TreeizeViewer::show_output.
All fields are optional.
If a field is None, the default value is used derived from the graph style.
Fields§
§shape: Option<PinShape>Shape of the pin.
fill: Option<Color32>Fill color of the pin.
stroke: Option<Stroke>Outline stroke of the pin.
wire_color: Option<Color32>Color of the wire connected to the pin.
If None, the pin’s fill color is used.
wire_style: Option<WireStyle>Style of the wire connected to the pin.
position: Option<f32>Custom vertical position of a pin
Implementations§
Source§impl PinInfo
impl PinInfo
Sourcepub const fn with_shape(self, shape: PinShape) -> Self
pub const fn with_shape(self, shape: PinShape) -> Self
Sets the shape of the pin.
Sourcepub const fn with_stroke(self, stroke: Stroke) -> Self
pub const fn with_stroke(self, stroke: Stroke) -> Self
Sets the outline stroke of the pin.
Sourcepub const fn with_wire_style(self, wire_style: WireStyle) -> Self
pub const fn with_wire_style(self, wire_style: WireStyle) -> Self
Sets the style of the wire connected to the pin.
Sourcepub const fn with_wire_color(self, wire_color: Color32) -> Self
pub const fn with_wire_color(self, wire_color: Color32) -> Self
Sets the color of the wire connected to the pin.
Sourcepub fn get_shape(&self, treeize_style: &TreeizeStyle) -> PinShape
pub fn get_shape(&self, treeize_style: &TreeizeStyle) -> PinShape
Returns the shape of the pin.
Sourcepub fn get_fill(&self, treeize_style: &TreeizeStyle, style: &Style) -> Color32
pub fn get_fill(&self, treeize_style: &TreeizeStyle, style: &Style) -> Color32
Returns fill color of the pin.
Sourcepub fn get_stroke(&self, treeize_style: &TreeizeStyle, style: &Style) -> Stroke
pub fn get_stroke(&self, treeize_style: &TreeizeStyle, style: &Style) -> Stroke
Returns outline stroke of the pin.
Sourcepub fn draw(
&self,
treeize_style: &TreeizeStyle,
style: &Style,
rect: Rect,
painter: &Painter,
) -> PinWireInfo
pub fn draw( &self, treeize_style: &TreeizeStyle, style: &Style, rect: Rect, painter: &Painter, ) -> PinWireInfo
Draws the pin and returns color.
Wires are drawn with returned color by default.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for PinInfo
impl RefUnwindSafe for PinInfo
impl Send for PinInfo
impl Sync for PinInfo
impl Unpin for PinInfo
impl UnwindSafe for PinInfo
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