pub struct KnowledgeBridge {
pub project_hash: String,
pub shared_facts: Vec<BridgeEntry>,
pub updated_at: DateTime<Utc>,
}Fields§
§project_hash: String§updated_at: DateTime<Utc>Implementations§
Source§impl KnowledgeBridge
impl KnowledgeBridge
pub fn new(project_hash: &str) -> Self
pub fn path(project_hash: &str) -> Result<PathBuf, String>
pub fn load(project_hash: &str) -> Option<Self>
pub fn load_or_create(project_hash: &str) -> Self
pub fn save(&mut self) -> Result<(), String>
Sourcepub fn publish(&mut self, agent_id: &str, facts: &[KnowledgeFact]) -> u32
pub fn publish(&mut self, agent_id: &str, facts: &[KnowledgeFact]) -> u32
Publish eligible facts from an agent’s knowledge store. Only publishes facts with sufficient confidence, a publishable archetype, and that haven’t already been published by this agent.
Sourcepub fn pull(&self, requesting_agent: &str) -> Vec<BridgeEntry>
pub fn pull(&self, requesting_agent: &str) -> Vec<BridgeEntry>
Pull facts from the bridge that were published by other agents.
Sourcepub fn entry_to_fact(entry: &BridgeEntry) -> KnowledgeFact
pub fn entry_to_fact(entry: &BridgeEntry) -> KnowledgeFact
Convert a BridgeEntry into a KnowledgeFact for import.
Applies a 10% trust penalty to imported confidence.
Sourcepub fn cleanup(&mut self, max_age_days: i64, min_confidence: f32) -> usize
pub fn cleanup(&mut self, max_age_days: i64, min_confidence: f32) -> usize
Remove entries older than max_age_days or below min_confidence.
pub fn entries_for_agent(&self, agent_id: &str) -> Vec<&BridgeEntry>
pub fn summary(&self) -> String
Trait Implementations§
Source§impl Clone for KnowledgeBridge
impl Clone for KnowledgeBridge
Source§fn clone(&self) -> KnowledgeBridge
fn clone(&self) -> KnowledgeBridge
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 moreSource§impl Debug for KnowledgeBridge
impl Debug for KnowledgeBridge
Source§impl<'de> Deserialize<'de> for KnowledgeBridge
impl<'de> Deserialize<'de> for KnowledgeBridge
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 KnowledgeBridge
impl RefUnwindSafe for KnowledgeBridge
impl Send for KnowledgeBridge
impl Sync for KnowledgeBridge
impl Unpin for KnowledgeBridge
impl UnsafeUnpin for KnowledgeBridge
impl UnwindSafe for KnowledgeBridge
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 more