pub struct Edge {
pub id: EdgeId,
pub source: VertexId,
pub target: VertexId,
pub weight: Option<f64>,
pub metadata: EdgeMetadata,
}Expand description
A graph edge connecting two vertices
Fields§
§id: EdgeIdUnique identifier
source: VertexIdSource vertex ID
target: VertexIdTarget vertex ID
weight: Option<f64>Optional edge weight
metadata: EdgeMetadataMetadata
Implementations§
Source§impl Edge
impl Edge
Sourcepub fn new(
source: VertexId,
target: VertexId,
replica: ReplicaId,
timestamp: u64,
) -> Self
pub fn new( source: VertexId, target: VertexId, replica: ReplicaId, timestamp: u64, ) -> Self
Create a new edge
Sourcepub fn with_weight(
source: VertexId,
target: VertexId,
weight: f64,
replica: ReplicaId,
timestamp: u64,
) -> Self
pub fn with_weight( source: VertexId, target: VertexId, weight: f64, replica: ReplicaId, timestamp: u64, ) -> Self
Create a new edge with weight
Sourcepub fn mark_modified(&mut self, replica: ReplicaId, timestamp: u64)
pub fn mark_modified(&mut self, replica: ReplicaId, timestamp: u64)
Mark as modified
Sourcepub fn mark_deleted(&mut self, replica: ReplicaId, timestamp: u64)
pub fn mark_deleted(&mut self, replica: ReplicaId, timestamp: u64)
Mark as deleted
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 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