Skip to main content

Edge

Struct Edge 

Source
pub struct Edge {
Show 18 fields pub id: Id, pub source: Id, pub target: Id, pub source_handle: Option<Id>, pub target_handle: Option<Id>, pub source_seat: Option<PortSeat>, pub target_seat: Option<PortSeat>, pub label: Option<String>, pub label_position: f64, pub weight: u8, pub kind: EdgeKind, pub animated: bool, pub selected: bool, pub selectable: bool, pub marker_start: MarkerKind, pub marker_end: MarkerKind, pub class: Option<String>, pub style: Option<String>,
}
Expand description

An edge connecting two nodes.

Fields§

§id: Id§source: Id§target: Id§source_handle: Option<Id>

Optional id of a specific source crate::Handle on the source node.

§target_handle: Option<Id>

Optional id of a specific target crate::Handle on the target node.

§source_seat: Option<PortSeat>

Under AnchorMode::Seats: the seat this end is pinned to. None leaves the end to the solver, which is where every connection starts.

§target_seat: Option<PortSeat>§label: Option<String>§label_position: f64

Where the label sits along the edge, as a fraction of the curve (clamped to the drawable range). Seat-anchored edges honour it; the default is the midpoint.

§weight: u8

Stroke emphasis, 1–3. Seat-anchored arrowheads scale with it, so a heavier edge carries a proportionate head. Styling the stroke itself stays in style/CSS.

§kind: EdgeKind§animated: bool

Animated edges render a marching-dashes effect.

§selected: bool§selectable: bool§marker_start: MarkerKind§marker_end: MarkerKind§class: Option<String>

Extra CSS classes for the edge group.

§style: Option<String>

Extra inline CSS for the visible edge path (e.g. stroke: #f43f5e).

Implementations§

Source§

impl Edge

Source

pub fn new(source: impl Into<Id>, target: impl Into<Id>) -> Self

Create an edge from source to target with an autogenerated id.

Source

pub fn id(self, id: impl Into<Id>) -> Self

Source

pub fn label(self, label: impl Into<String>) -> Self

Source

pub fn label_position(self, position: f64) -> Self

Place the label at position (0..=1) along the curve.

Source

pub fn weight(self, weight: u8) -> Self

Stroke emphasis, 1–3; seat-anchored arrowheads scale with it.

Source

pub fn kind(self, kind: EdgeKind) -> Self

Source

pub fn animated(self, animated: bool) -> Self

Source

pub fn marker_start(self, marker: MarkerKind) -> Self

Source

pub fn marker_end(self, marker: MarkerKind) -> Self

Source

pub fn source_seat(self, seat: PortSeat) -> Self

Pin this edge’s source end to a seat (used under AnchorMode::Seats).

Source

pub fn target_seat(self, seat: PortSeat) -> Self

Pin this edge’s target end to a seat (used under AnchorMode::Seats).

Source

pub fn source_handle(self, id: impl Into<Id>) -> Self

Source

pub fn target_handle(self, id: impl Into<Id>) -> Self

Source

pub fn class(self, class: impl Into<String>) -> Self

Source

pub fn style(self, style: impl Into<String>) -> Self

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<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> DependencyElement for T
where T: 'static + PartialEq + Clone,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> InitializeFromFunction<T> for T

Source§

fn initialize_from_function(f: fn() -> T) -> T

Create an instance of this type from an initialization function
Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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<Ret> SpawnIfAsync<(), Ret> for Ret

Source§

fn spawn(self) -> Ret

Spawn the value into the dioxus runtime if it is an async block
Source§

impl<T, O> SuperFrom<T> for O
where O: From<T>,

Source§

fn super_from(input: T) -> O

Convert from a type to another type.
Source§

impl<T, O, M> SuperInto<O, M> for T
where O: SuperFrom<T, M>,

Source§

fn super_into(self) -> O

Convert from a type to another type.
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<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more