pub struct Edge<T = ()> {Show 14 fields
pub id: EdgeId,
pub source: NodeId,
pub target: NodeId,
pub data: T,
pub source_handle: Option<String>,
pub target_handle: Option<String>,
pub edge_type: Option<String>,
pub selected: bool,
pub animated: bool,
pub hidden: bool,
pub selectable: bool,
pub deletable: bool,
pub z_index: Option<i32>,
pub label: Option<String>,
}Expand description
Edge connecting two nodes
Fields§
§id: EdgeId§source: NodeId§target: NodeId§data: T§source_handle: Option<String>§target_handle: Option<String>§edge_type: Option<String>§selected: bool§animated: bool§selectable: bool§deletable: bool§z_index: Option<i32>§label: Option<String>Implementations§
Source§impl<T> Edge<T>
impl<T> Edge<T>
Sourcepub fn new(
id: impl Into<EdgeId>,
source: impl Into<NodeId>,
target: impl Into<NodeId>,
data: T,
) -> Self
pub fn new( id: impl Into<EdgeId>, source: impl Into<NodeId>, target: impl Into<NodeId>, data: T, ) -> Self
Create a new edge
Sourcepub fn builder() -> EdgeBuilder<T>
pub fn builder() -> EdgeBuilder<T>
Create a builder for fluent construction
Sourcepub fn set_selected(&mut self, selected: bool)
pub fn set_selected(&mut self, selected: bool)
Set selection state
Sourcepub fn connects(&self, source_id: &NodeId, target_id: &NodeId) -> bool
pub fn connects(&self, source_id: &NodeId, target_id: &NodeId) -> bool
Check if edge connects the given nodes
Sourcepub fn is_connected_to(&self, node_id: &NodeId) -> bool
pub fn is_connected_to(&self, node_id: &NodeId) -> bool
Check if edge is connected to the given node
Sourcepub fn with_source_handle(self, handle_id: impl Into<String>) -> Self
pub fn with_source_handle(self, handle_id: impl Into<String>) -> Self
Set source handle
Sourcepub fn with_target_handle(self, handle_id: impl Into<String>) -> Self
pub fn with_target_handle(self, handle_id: impl Into<String>) -> Self
Set target handle
Trait Implementations§
impl<T> StructuralPartialEq for Edge<T>
Auto Trait Implementations§
impl<T> Freeze for Edge<T>where
T: Freeze,
impl<T> RefUnwindSafe for Edge<T>where
T: RefUnwindSafe,
impl<T> Send for Edge<T>where
T: Send,
impl<T> Sync for Edge<T>where
T: Sync,
impl<T> Unpin for Edge<T>where
T: Unpin,
impl<T> UnwindSafe for Edge<T>where
T: UnwindSafe,
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