pub struct Edge {
pub src: String,
pub dst: String,
pub kind: EdgeKind,
pub provenance: Provenance,
pub confidence: Option<f64>,
pub src_ref: Option<String>,
}Expand description
An edge in the knowledge graph, connecting two nodes by their keys.
The Provenance invariant is enforced on insert: confidence is present
if and only if the provenance is Provenance::Inferred.
Fields§
§src: StringNatural key of the source node.
dst: StringNatural key of the destination node.
kind: EdgeKindThe relationship this edge records.
provenance: ProvenanceHow this edge was produced.
confidence: Option<f64>Confidence score in 0.0..=1.0; Some iff provenance is inferred.
src_ref: Option<String>Where the fact came from (e.g. blob#span, or an ADR id).
Implementations§
Source§impl Edge
impl Edge
Sourcepub fn derived(
src: impl Into<String>,
dst: impl Into<String>,
kind: EdgeKind,
) -> Self
pub fn derived( src: impl Into<String>, dst: impl Into<String>, kind: EdgeKind, ) -> Self
Construct a derived edge (no confidence).
Construct an authored edge (no confidence).
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