pub struct Hyperedge {
pub id: HyperedgeId,
pub nodes: Vec<NodeId>,
pub edge_type: String,
pub description: Option<String>,
pub properties: Properties,
pub confidence: f32,
}Expand description
Hyperedge connecting multiple nodes (N-ary relationship)
Fields§
§id: HyperedgeIdUnique identifier
nodes: Vec<NodeId>Node IDs connected by this hyperedge
edge_type: StringHyperedge type/label (e.g., “MEETING”, “COLLABORATION”)
description: Option<String>Natural language description of the relationship
properties: PropertiesProperty key-value pairs
confidence: f32Confidence/weight (0.0-1.0)
Implementations§
Source§impl Hyperedge
impl Hyperedge
Sourcepub fn new<S: Into<String>>(nodes: Vec<NodeId>, edge_type: S) -> Self
pub fn new<S: Into<String>>(nodes: Vec<NodeId>, edge_type: S) -> Self
Create a new hyperedge with generated UUID
Sourcepub fn with_id<S: Into<String>>(
id: HyperedgeId,
nodes: Vec<NodeId>,
edge_type: S,
) -> Self
pub fn with_id<S: Into<String>>( id: HyperedgeId, nodes: Vec<NodeId>, edge_type: S, ) -> Self
Create a new hyperedge with specific ID
Sourcepub fn contains_node(&self, node_id: &NodeId) -> bool
pub fn contains_node(&self, node_id: &NodeId) -> bool
Check if hyperedge contains a specific node
Sourcepub fn contains_all_nodes(&self, node_ids: &[NodeId]) -> bool
pub fn contains_all_nodes(&self, node_ids: &[NodeId]) -> bool
Check if hyperedge contains all specified nodes
Sourcepub fn contains_any_node(&self, node_ids: &[NodeId]) -> bool
pub fn contains_any_node(&self, node_ids: &[NodeId]) -> bool
Check if hyperedge contains any of the specified nodes
Sourcepub fn unique_nodes(&self) -> HashSet<&NodeId>
pub fn unique_nodes(&self) -> HashSet<&NodeId>
Get unique nodes (removes duplicates)
Sourcepub fn set_description<S: Into<String>>(&mut self, description: S) -> &mut Self
pub fn set_description<S: Into<String>>(&mut self, description: S) -> &mut Self
Set the description
Sourcepub fn set_confidence(&mut self, confidence: f32) -> &mut Self
pub fn set_confidence(&mut self, confidence: f32) -> &mut Self
Set the confidence
Sourcepub fn set_property<K, V>(&mut self, key: K, value: V) -> &mut Self
pub fn set_property<K, V>(&mut self, key: K, value: V) -> &mut Self
Set a property
Sourcepub fn get_property(&self, key: &str) -> Option<&PropertyValue>
pub fn get_property(&self, key: &str) -> Option<&PropertyValue>
Get a property
Sourcepub fn remove_property(&mut self, key: &str) -> Option<PropertyValue>
pub fn remove_property(&mut self, key: &str) -> Option<PropertyValue>
Remove a property
Sourcepub fn has_property(&self, key: &str) -> bool
pub fn has_property(&self, key: &str) -> bool
Check if hyperedge has a property
Sourcepub fn property_keys(&self) -> Vec<&String>
pub fn property_keys(&self) -> Vec<&String>
Get all property keys
Sourcepub fn clear_properties(&mut self)
pub fn clear_properties(&mut self)
Clear all properties
Sourcepub fn property_count(&self) -> usize
pub fn property_count(&self) -> usize
Get the number of properties
Trait Implementations§
Source§impl<'__de, __Context> BorrowDecode<'__de, __Context> for Hyperedge
impl<'__de, __Context> BorrowDecode<'__de, __Context> for Hyperedge
Source§fn borrow_decode<__D: BorrowDecoder<'__de, Context = __Context>>(
decoder: &mut __D,
) -> Result<Self, DecodeError>
fn borrow_decode<__D: BorrowDecoder<'__de, Context = __Context>>( decoder: &mut __D, ) -> Result<Self, DecodeError>
Attempt to decode this type with the given BorrowDecode.
Source§impl<'de> Deserialize<'de> for Hyperedge
impl<'de> Deserialize<'de> for Hyperedge
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 Hyperedge
impl RefUnwindSafe for Hyperedge
impl Send for Hyperedge
impl Sync for Hyperedge
impl Unpin for Hyperedge
impl UnwindSafe for Hyperedge
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> 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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request