pub struct Edge {
pub id: EdgeId,
pub graphify_key: Option<ExternalId>,
pub source: NodeId,
pub target: NodeId,
pub label: Option<String>,
pub weight: Option<f64>,
pub attributes: Attributes,
}Expand description
Immutable edge input and public edge record.
Fields§
§id: EdgeIdStable unique edge identity.
graphify_key: Option<ExternalId>Optional Graphify multigraph key.
source: NodeIdStored source node external ID.
target: NodeIdStored target node external ID.
label: Option<String>Optional Helix edge label.
weight: Option<f64>Optional validated non-negative finite weight.
attributes: AttributesSelected immutable properties.
Implementations§
Source§impl Edge
impl Edge
Sourcepub fn new(
id: impl Into<EdgeId>,
source: impl Into<NodeId>,
target: impl Into<NodeId>,
) -> Self
pub fn new( id: impl Into<EdgeId>, source: impl Into<NodeId>, target: impl Into<NodeId>, ) -> Self
Construct an unweighted edge without a label or selected properties.
Sourcepub fn with_graphify_key(self, key: impl Into<ExternalId>) -> Self
pub fn with_graphify_key(self, key: impl Into<ExternalId>) -> Self
Attach a Graphify multigraph key.
Sourcepub fn with_label(self, label: impl Into<String>) -> Self
pub fn with_label(self, label: impl Into<String>) -> Self
Attach a label.
Sourcepub fn with_weight(self, weight: f64) -> Self
pub fn with_weight(self, weight: f64) -> Self
Attach an algorithm weight.
Sourcepub fn with_attributes(self, attributes: Attributes) -> Self
pub fn with_attributes(self, attributes: Attributes) -> Self
Attach selected properties.
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