pub struct MotifInstance {
pub motif_type: GraphMotif,
pub nodes: Vec<NodeId>,
pub edges: Vec<EdgeId>,
pub total_weight: f64,
pub time_span_days: Option<i64>,
pub confidence: f64,
pub metadata: HashMap<String, String>,
}Expand description
A generic motif instance.
Fields§
§motif_type: GraphMotifType of motif.
nodes: Vec<NodeId>Nodes involved in the motif.
edges: Vec<EdgeId>Edges involved in the motif.
total_weight: f64Total weight of edges.
time_span_days: Option<i64>Time span in days (if available).
confidence: f64Confidence score.
metadata: HashMap<String, String>Additional metadata.
Implementations§
Source§impl MotifInstance
impl MotifInstance
Sourcepub fn new(
motif_type: GraphMotif,
nodes: Vec<NodeId>,
edges: Vec<EdgeId>,
total_weight: f64,
) -> Self
pub fn new( motif_type: GraphMotif, nodes: Vec<NodeId>, edges: Vec<EdgeId>, total_weight: f64, ) -> Self
Creates a new motif instance.
Sourcepub fn with_time_span(self, days: i64) -> Self
pub fn with_time_span(self, days: i64) -> Self
Sets the time span.
Sourcepub fn with_confidence(self, confidence: f64) -> Self
pub fn with_confidence(self, confidence: f64) -> Self
Sets the confidence score.
Sourcepub fn with_metadata(self, key: &str, value: &str) -> Self
pub fn with_metadata(self, key: &str, value: &str) -> Self
Adds metadata.
Trait Implementations§
Source§impl Clone for MotifInstance
impl Clone for MotifInstance
Source§fn clone(&self) -> MotifInstance
fn clone(&self) -> MotifInstance
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for MotifInstance
impl Debug for MotifInstance
Source§impl<'de> Deserialize<'de> for MotifInstance
impl<'de> Deserialize<'de> for MotifInstance
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 MotifInstance
impl RefUnwindSafe for MotifInstance
impl Send for MotifInstance
impl Sync for MotifInstance
impl Unpin for MotifInstance
impl UnwindSafe for MotifInstance
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