weavatrix_semantic/linker/
report.rs1use super::{CandidateBackend, SemanticLinkReport};
2
3impl CandidateBackend {
4 #[must_use]
6 pub const fn as_str(self) -> &'static str {
7 match self {
8 Self::Exact => "exact",
9 Self::WeavatrixVector => "weavatrix_search_vector",
10 }
11 }
12
13 #[must_use]
15 pub const fn is_exact(self) -> bool {
16 matches!(self, Self::Exact)
17 }
18}
19
20impl SemanticLinkReport {
21 #[must_use]
23 pub const fn vector_count(&self) -> usize {
24 self.vector_count
25 }
26
27 #[must_use]
29 pub const fn dimension(&self) -> usize {
30 self.dimension
31 }
32
33 #[must_use]
35 pub const fn comparisons(&self) -> u64 {
36 self.comparisons
37 }
38
39 #[must_use]
41 pub const fn pair_count(&self) -> usize {
42 self.pair_count
43 }
44
45 #[must_use]
47 pub const fn candidate_backend(&self) -> CandidateBackend {
48 self.candidate_backend
49 }
50
51 #[must_use]
53 pub fn policy_id(&self) -> &str {
54 &self.policy_id
55 }
56
57 #[must_use]
59 pub const fn edge_count(&self) -> usize {
60 self.edges.len()
61 }
62
63 #[must_use]
65 pub fn edges(&self) -> &[weavatrix_graph::Edge] {
66 &self.edges
67 }
68
69 #[must_use]
71 pub fn into_edges(self) -> Vec<weavatrix_graph::Edge> {
72 self.edges
73 }
74}