pub struct GraphEdge {
pub from: String,
pub to: String,
pub label: Option<String>,
pub edge_type: String,
pub weight: f64,
pub directed: bool,
pub attributes: HashMap<String, String>,
}Expand description
Graph edge for visualization
Fields§
§from: StringSource node ID.
to: StringTarget node ID.
label: Option<String>Optional label for the edge.
edge_type: StringType of the edge.
weight: f64Weight of the edge for layout algorithms.
directed: boolWhether the edge is directed.
attributes: HashMap<String, String>Additional attributes for the edge.
Implementations§
Source§impl GraphEdge
impl GraphEdge
Sourcepub fn with_label(self, label: String) -> Self
pub fn with_label(self, label: String) -> Self
Sets the label of the edge.
Sourcepub fn with_weight(self, weight: f64) -> Self
pub fn with_weight(self, weight: f64) -> Self
Sets the weight of the edge.
Sourcepub fn undirected(self) -> Self
pub fn undirected(self) -> Self
Makes the edge undirected.
Sourcepub fn with_attribute(self, key: String, value: String) -> Self
pub fn with_attribute(self, key: String, value: String) -> Self
Adds an attribute to the edge.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for GraphEdge
impl<'de> Deserialize<'de> for GraphEdge
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for GraphEdge
impl RefUnwindSafe for GraphEdge
impl Send for GraphEdge
impl Sync for GraphEdge
impl Unpin for GraphEdge
impl UnsafeUnpin for GraphEdge
impl UnwindSafe for GraphEdge
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