pub struct GraphEdge {
pub id: String,
pub source_id: String,
pub target_id: String,
pub label: String,
pub edge_type: EdgeType,
pub attributes: HashMap<String, Value>,
pub weight: f32,
pub confidence: f32,
pub source_documents: HashSet<String>,
pub created_at: DateTime<Utc>,
}Expand description
Graph edge representing relationships
Fields§
§id: StringUnique edge identifier
source_id: StringSource node ID
target_id: StringTarget node ID
label: StringEdge label/relationship type
edge_type: EdgeTypeEdge type
attributes: HashMap<String, Value>Edge attributes
weight: f32Edge weight/strength
confidence: f32Edge confidence score
source_documents: HashSet<String>Source document references
created_at: DateTime<Utc>Creation timestamp
Implementations§
Source§impl GraphEdge
impl GraphEdge
Sourcepub fn new(
source_id: impl Into<String>,
target_id: impl Into<String>,
label: impl Into<String>,
edge_type: EdgeType,
) -> Self
pub fn new( source_id: impl Into<String>, target_id: impl Into<String>, label: impl Into<String>, edge_type: EdgeType, ) -> Self
Create a new graph edge
Sourcepub fn with_id(
id: impl Into<String>,
source_id: impl Into<String>,
target_id: impl Into<String>,
label: impl Into<String>,
edge_type: EdgeType,
) -> Self
pub fn with_id( id: impl Into<String>, source_id: impl Into<String>, target_id: impl Into<String>, label: impl Into<String>, edge_type: EdgeType, ) -> Self
Create edge with specific ID
Sourcepub fn with_attribute(self, key: impl Into<String>, value: Value) -> Self
pub fn with_attribute(self, key: impl Into<String>, value: Value) -> Self
Add attribute using builder pattern
Sourcepub fn with_weight(self, weight: f32) -> Self
pub fn with_weight(self, weight: f32) -> Self
Set edge weight
Sourcepub fn with_confidence(self, confidence: f32) -> Self
pub fn with_confidence(self, confidence: f32) -> Self
Set confidence score
Sourcepub fn with_source_document(self, document_id: impl Into<String>) -> Self
pub fn with_source_document(self, document_id: impl Into<String>) -> Self
Add source document
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 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