pub struct KnowledgePack { /* private fields */ }Expand description
Knowledge corpus pack — atoms, domains, TF-IDF search, fold, import, and KG concept verbs.
Implementations§
Source§impl KnowledgePack
impl KnowledgePack
Sourcepub fn new(runtime: KhiveRuntime) -> Self
pub fn new(runtime: KhiveRuntime) -> Self
Create a new pack bound to the given runtime, initializing a shared ANN index.
Trait Implementations§
Source§impl Pack for KnowledgePack
impl Pack for KnowledgePack
Source§const NOTE_KINDS: &'static [&'static str]
const NOTE_KINDS: &'static [&'static str]
Note kinds this pack contributes to the runtime vocabulary.
Source§const ENTITY_KINDS: &'static [&'static str]
const ENTITY_KINDS: &'static [&'static str]
Entity kinds this pack contributes to the runtime vocabulary.
Source§const HANDLERS: &'static [HandlerDef]
const HANDLERS: &'static [HandlerDef]
Handlers this pack registers. Read more
Source§const REQUIRES: &'static [&'static str]
const REQUIRES: &'static [&'static str]
Other pack names whose vocabulary this pack references. Read more
Source§const EDGE_RULES: &'static [EdgeEndpointRule] = _
const EDGE_RULES: &'static [EdgeEndpointRule] = _
Additional edge endpoint rules this pack contributes. Read more
Source§const NOTE_KIND_SPECS: &'static [NoteKindSpec] = _
const NOTE_KIND_SPECS: &'static [NoteKindSpec] = _
Lifecycle and schema specs for note kinds this pack owns. Read more
Source§const SCHEMA_PLAN: Option<PackSchemaPlan> = None
const SCHEMA_PLAN: Option<PackSchemaPlan> = None
Pack-auxiliary schema plan. Read more
Source§const VALIDATION_RULES: &'static [&'static str] = _
const VALIDATION_RULES: &'static [&'static str] = _
Validation rule IDs contributed by this pack. Read more
Source§impl PackByIdResolver for KnowledgePack
impl PackByIdResolver for KnowledgePack
Source§fn resolve_by_id<'life0, 'async_trait>(
&'life0 self,
id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<Option<Resolved>, RuntimeError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn resolve_by_id<'life0, 'async_trait>(
&'life0 self,
id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<Option<Resolved>, RuntimeError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Resolve a live knowledge record by UUID.
Queries knowledge_domains first (canonical record), then
knowledge_atoms. The domain mirror atom shares the domain’s UUID
(crud.rs:279/300) so domains must win over the mirror.
Source§fn resolve_by_id_including_deleted<'life0, 'async_trait>(
&'life0 self,
id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<Option<Resolved>, RuntimeError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn resolve_by_id_including_deleted<'life0, 'async_trait>(
&'life0 self,
id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<Option<Resolved>, RuntimeError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Resolve a knowledge record including already-soft-deleted records.
Used by the hard-delete path to locate tombstoned records.
Source§fn delete_by_id<'life0, 'async_trait>(
&'life0 self,
id: Uuid,
hard: bool,
) -> Pin<Box<dyn Future<Output = Result<Value, RuntimeError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn delete_by_id<'life0, 'async_trait>(
&'life0 self,
id: Uuid,
hard: bool,
) -> Pin<Box<dyn Future<Output = Result<Value, RuntimeError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Delete a knowledge domain or atom by UUID.
Soft-delete by default (hard=false): sets deleted_at = now().
For domains, also tombstones the mirror atom in knowledge_atoms.
Hard-delete (hard=true): permanently removes rows from the table(s).
Source§impl PackRuntime for KnowledgePack
impl PackRuntime for KnowledgePack
Source§fn note_kinds(&self) -> &'static [&'static str]
fn note_kinds(&self) -> &'static [&'static str]
Note kinds this pack owns — must equal
<Self as Pack>::NOTE_KINDS.Source§fn entity_kinds(&self) -> &'static [&'static str]
fn entity_kinds(&self) -> &'static [&'static str]
Entity kinds this pack owns — must equal
<Self as Pack>::ENTITY_KINDS.Source§fn handlers(&self) -> &'static [HandlerDef]
fn handlers(&self) -> &'static [HandlerDef]
Handlers this pack registers — must equal
<Self as Pack>::HANDLERS.Source§fn requires(&self) -> &'static [&'static str]
fn requires(&self) -> &'static [&'static str]
Pack names whose vocabulary this pack references.
Defaults to empty so existing packs compile without changes.
Source§fn warm<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn warm<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Warm up any in-memory state from persisted snapshots (optional). Read more
Source§fn dispatch<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
verb: &'life1 str,
params: Value,
registry: &'life2 VerbRegistry,
token: &'life3 NamespaceToken,
) -> Pin<Box<dyn Future<Output = Result<Value, RuntimeError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn dispatch<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
verb: &'life1 str,
params: Value,
registry: &'life2 VerbRegistry,
token: &'life3 NamespaceToken,
) -> Pin<Box<dyn Future<Output = Result<Value, RuntimeError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Dispatch a verb call. Returns serialized JSON response. Read more
Source§fn edge_rules(&self) -> &'static [EdgeEndpointRule]
fn edge_rules(&self) -> &'static [EdgeEndpointRule]
Pack-extensible edge endpoint rules — must equal
<Self as Pack>::EDGE_RULES.
Defaults to empty so existing packs that don’t extend the edge contract
can ignore it.Source§fn note_kind_specs(&self) -> &'static [NoteKindSpec]
fn note_kind_specs(&self) -> &'static [NoteKindSpec]
NoteKindSpec declarations for note kinds this pack owns. Read more
Source§fn kind_hook(&self, _kind: &str) -> Option<Arc<dyn KindHook>>
fn kind_hook(&self, _kind: &str) -> Option<Arc<dyn KindHook>>
Optional per-kind hook for shared CRUD specialization. Read more
Source§fn schema_plan(&self) -> SchemaPlan
fn schema_plan(&self) -> SchemaPlan
Pack-auxiliary schema. Read more
Source§fn validation_rules(&self) -> &'static [ValidationRule]
fn validation_rules(&self) -> &'static [ValidationRule]
Domain-specific validation rules contributed by this pack. Read more
Source§fn register_embedders(&self, _runtime: &KhiveRuntime)
fn register_embedders(&self, _runtime: &KhiveRuntime)
Register custom embedding providers with the runtime. Read more
Source§fn register_entity_type_validator(&self, _runtime: &KhiveRuntime)
fn register_entity_type_validator(&self, _runtime: &KhiveRuntime)
Install a pack-owned entity-type validator on the runtime. Read more
Auto Trait Implementations§
impl !Freeze for KnowledgePack
impl !RefUnwindSafe for KnowledgePack
impl !UnwindSafe for KnowledgePack
impl Send for KnowledgePack
impl Sync for KnowledgePack
impl Unpin for KnowledgePack
impl UnsafeUnpin for KnowledgePack
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> 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 more