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: EdgeId
Unique identifier
source: VertexId
Source vertex ID
target: VertexId
Target vertex ID
weight: Option<f64>
Optional edge weight
metadata: EdgeMetadata
Metadata
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> FromFormData for Twhere
T: DeserializeOwned,
impl<T> FromFormData for Twhere
T: DeserializeOwned,
Source§fn from_event(ev: &Event) -> Result<T, FromFormDataError>
fn from_event(ev: &Event) -> Result<T, FromFormDataError>
Tries to deserialize the data, given only the
submit
event.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> SerializableKey for T
impl<T> SerializableKey for T
Source§impl<T> StorageAccess<T> for T
impl<T> StorageAccess<T> for T
Source§fn as_borrowed(&self) -> &T
fn as_borrowed(&self) -> &T
Borrows the value.
Source§fn into_taken(self) -> T
fn into_taken(self) -> T
Takes the value.