pub struct Edge {
pub id: EdgeId,
pub src: NodeId,
pub dst: NodeId,
pub edge_type: Arc<str>,
pub properties: BTreeMap<PropertyKey, Value>,
}Expand description
An edge in the labeled property graph.
This is the high-level representation of an edge with all its data.
Fields§
§id: EdgeIdUnique identifier.
src: NodeIdSource node ID.
dst: NodeIdDestination node ID.
edge_type: Arc<str>Edge type/label.
properties: BTreeMap<PropertyKey, Value>Properties stored on this edge.
Implementations§
Source§impl Edge
impl Edge
Sourcepub fn new(
id: EdgeId,
src: NodeId,
dst: NodeId,
edge_type: impl Into<Arc<str>>,
) -> Self
pub fn new( id: EdgeId, src: NodeId, dst: NodeId, edge_type: impl Into<Arc<str>>, ) -> Self
Creates a new edge.
Sourcepub fn set_property(
&mut self,
key: impl Into<PropertyKey>,
value: impl Into<Value>,
)
pub fn set_property( &mut self, key: impl Into<PropertyKey>, value: impl Into<Value>, )
Sets a property on this edge.
Sourcepub fn get_property(&self, key: &str) -> Option<&Value>
pub fn get_property(&self, key: &str) -> Option<&Value>
Gets a property from this edge.
Sourcepub fn remove_property(&mut self, key: &str) -> Option<Value>
pub fn remove_property(&mut self, key: &str) -> Option<Value>
Removes a property from this edge.
Sourcepub fn other_endpoint(&self, node: NodeId) -> Option<NodeId>
pub fn other_endpoint(&self, node: NodeId) -> Option<NodeId>
Returns the other endpoint of this edge given one endpoint.
Returns None if node is neither the source nor destination.
Trait Implementations§
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