pub struct SemanticLinker { /* private fields */ }Expand description
Exact cosine top-K semantic linker for existing graph nodes.
Implementations§
Source§impl SemanticLinker
impl SemanticLinker
Sourcepub fn new(config: LinkConfig) -> Result<Self>
pub fn new(config: LinkConfig) -> Result<Self>
Validates configuration and constructs a linker.
§Errors
Returns invalid model, threshold, top-K, vector bound, or edge kind.
pub const fn config(&self) -> &LinkConfig
Sourcepub fn link(
&self,
graph: &Graph,
vectors: &[SemanticVector],
) -> Result<SemanticLinkReport>
pub fn link( &self, graph: &Graph, vectors: &[SemanticVector], ) -> Result<SemanticLinkReport>
Produces deterministic semantic edges without mutating the graph.
§Errors
Returns vector or graph validation failures.
Sourcepub fn link_with_policy<P: LinkPolicy + ?Sized>(
&self,
graph: &Graph,
vectors: &[SemanticVector],
policy: &P,
) -> Result<SemanticLinkReport>
pub fn link_with_policy<P: LinkPolicy + ?Sized>( &self, graph: &Graph, vectors: &[SemanticVector], policy: &P, ) -> Result<SemanticLinkReport>
Produces deterministic semantic edges under an explicit policy.
§Errors
Returns input validation or policy coverage failures.
Sourcepub fn relink(&self, graph: &Graph, vectors: &[SemanticVector]) -> Result<Graph>
pub fn relink(&self, graph: &Graph, vectors: &[SemanticVector]) -> Result<Graph>
Replaces previous semantic edges and returns a new graph.
§Errors
Returns input validation or graph-construction failures.
Sourcepub fn relink_with_policy<P: LinkPolicy + ?Sized>(
&self,
graph: &Graph,
vectors: &[SemanticVector],
policy: &P,
) -> Result<Graph>
pub fn relink_with_policy<P: LinkPolicy + ?Sized>( &self, graph: &Graph, vectors: &[SemanticVector], policy: &P, ) -> Result<Graph>
Replaces previous semantic edges under an explicit policy.
§Errors
Returns input validation, policy, or graph-construction failures.
Trait Implementations§
Source§impl Clone for SemanticLinker
impl Clone for SemanticLinker
Source§fn clone(&self) -> SemanticLinker
fn clone(&self) -> SemanticLinker
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for SemanticLinker
impl RefUnwindSafe for SemanticLinker
impl Send for SemanticLinker
impl Sync for SemanticLinker
impl Unpin for SemanticLinker
impl UnsafeUnpin for SemanticLinker
impl UnwindSafe for SemanticLinker
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