pub struct Edge {
pub id: EdgeId,
pub graphify_key: Option<ExternalId>,
pub source: ExternalId,
pub target: ExternalId,
pub label: Option<String>,
pub weight: Option<f64>,
pub attributes: BTreeMap<String, Value>,
}Expand description
Immutable edge input and public edge record.
Fields§
§id: EdgeIdStable unique edge identity.
graphify_key: Option<ExternalId>Optional Graphify multigraph key.
source: ExternalIdStored source node external ID.
target: ExternalIdStored target node external ID.
label: Option<String>Optional Helix edge label.
weight: Option<f64>Optional validated non-negative finite weight.
attributes: BTreeMap<String, Value>Selected immutable properties.
Implementations§
Source§impl Edge
impl Edge
Sourcepub fn new(
id: impl Into<EdgeId>,
source: impl Into<ExternalId>,
target: impl Into<ExternalId>,
) -> Edge
pub fn new( id: impl Into<EdgeId>, source: impl Into<ExternalId>, target: impl Into<ExternalId>, ) -> Edge
Construct an unweighted edge without a label or selected properties.
Sourcepub fn with_graphify_key(self, key: impl Into<ExternalId>) -> Edge
pub fn with_graphify_key(self, key: impl Into<ExternalId>) -> Edge
Attach a Graphify multigraph key.
Sourcepub fn with_label(self, label: impl Into<String>) -> Edge
pub fn with_label(self, label: impl Into<String>) -> Edge
Attach a label.
Sourcepub fn with_weight(self, weight: f64) -> Edge
pub fn with_weight(self, weight: f64) -> Edge
Attach an algorithm weight.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Edge
impl<'de> Deserialize<'de> for Edge
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<Edge, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<Edge, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Serialize for Edge
impl Serialize for Edge
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. 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