Skip to main content

Edge

Struct Edge 

Source
pub struct Edge {
    pub from: String,
    pub to: String,
    pub label: Option<String>,
    pub style: EdgeStyle,
    pub back: bool,
    pub from_y: f64,
    pub to_y: f64,
    pub gutter: Option<f64>,
    pub hook_x: Option<f64>,
    pub floor: Option<f64>,
}
Expand description

A positioned edge.

Fields§

§from: String

Identifier of the node it leaves.

§to: String

Identifier of the node it arrives at.

§label: Option<String>

all or any, for an edge into a barrier.

§style: EdgeStyle

How to draw it.

§back: bool

True when the edge points back towards the entry, which makes it a return path.

§from_y: f64

Where on the source’’s right edge this leaves, as an absolute y.

Edges all left from the node’’s centre, so several going to different places overlapped for their first stretch and only separated once they had already crossed each other. Spreading them down the edge, ordered by where they are going, means they never cross at the node they share.

§to_y: f64

Where on the target’’s left edge this arrives, as an absolute y.

§gutter: Option<f64>

For a return path, the x it climbs at. None for a forward edge.

Distinct per edge even when several return to the same agent. Sharing one gutter put four curves on the same vertical line with their labels stacked on top of each other.

§hook_x: Option<f64>

For a return path, where it hooks into the target’’s underside.

§floor: Option<f64>

For a return path, the depth it dips to. None for a forward edge.

Computed here rather than in the renderer because it decides how tall the drawing is, and a renderer that invented its own geometry would draw outside the reported extent — which is exactly how a review loop ends up clipped off the bottom of the diagram.

Trait Implementations§

Source§

impl Clone for Edge

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 Edge

Source§

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

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

impl PartialEq for Edge

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 StructuralPartialEq for Edge

Auto Trait Implementations§

§

impl Freeze for Edge

§

impl RefUnwindSafe for Edge

§

impl Send for Edge

§

impl Sync for Edge

§

impl Unpin for Edge

§

impl UnsafeUnpin for Edge

§

impl UnwindSafe for Edge

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

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> 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> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

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

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V