pub struct Edge {
pub from: String,
pub to: String,
pub relationship: Relationship,
pub weight: f32,
pub origin: EdgeOrigin,
}Expand description
An edge connecting two nodes in the graph.
Fields§
§from: StringSource node ID.
to: StringTarget node ID.
relationship: RelationshipType of relationship.
weight: f32Edge weight (influences pathfinding).
origin: EdgeOriginWhere this edge originated.
Implementations§
Source§impl Edge
impl Edge
Sourcepub fn new(
from: impl Into<String>,
to: impl Into<String>,
relationship: Relationship,
) -> Self
pub fn new( from: impl Into<String>, to: impl Into<String>, relationship: Relationship, ) -> Self
Creates a new edge with default weight from relationship type.
Sourcepub fn with_weight(self, weight: f32) -> Self
pub fn with_weight(self, weight: f32) -> Self
Sets an explicit weight.
Sourcepub fn with_origin(self, origin: EdgeOrigin) -> Self
pub fn with_origin(self, origin: EdgeOrigin) -> Self
Sets the edge origin.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Edge
impl<'de> Deserialize<'de> for Edge
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
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> 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