pub struct DistributedGoalResolver { /* private fields */ }Expand description
Distributed goal resolver
Implementations§
Source§impl DistributedGoalResolver
impl DistributedGoalResolver
Sourcepub fn new(local_kb: Arc<KnowledgeBase>) -> Self
pub fn new(local_kb: Arc<KnowledgeBase>) -> Self
Create a new distributed goal resolver
Sourcepub fn with_provider(self, provider: Arc<dyn RemoteKnowledgeProvider>) -> Self
pub fn with_provider(self, provider: Arc<dyn RemoteKnowledgeProvider>) -> Self
Set the remote knowledge provider
Sourcepub fn with_max_depth(self, max_depth: usize) -> Self
pub fn with_max_depth(self, max_depth: usize) -> Self
Set maximum depth
Sourcepub fn with_timeout(self, timeout_ms: u64) -> Self
pub fn with_timeout(self, timeout_ms: u64) -> Self
Set timeout in milliseconds
Sourcepub async fn resolve(
&mut self,
goal: &Predicate,
substitution: &Substitution,
) -> Result<Vec<Substitution>, RemoteReasoningError>
pub async fn resolve( &mut self, goal: &Predicate, substitution: &Substitution, ) -> Result<Vec<Substitution>, RemoteReasoningError>
Resolve a goal using both local and remote knowledge
Sourcepub async fn prefetch_facts(
&mut self,
predicate_name: &str,
) -> Result<usize, RemoteReasoningError>
pub async fn prefetch_facts( &mut self, predicate_name: &str, ) -> Result<usize, RemoteReasoningError>
Prefetch facts for a predicate from remote peers
Sourcepub fn get_cached_facts(&self, predicate_name: &str) -> Option<&[Predicate]>
pub fn get_cached_facts(&self, predicate_name: &str) -> Option<&[Predicate]>
Get cached remote facts
Sourcepub fn clear_cache(&mut self)
pub fn clear_cache(&mut self)
Clear the remote fact cache
Auto Trait Implementations§
impl Freeze for DistributedGoalResolver
impl !RefUnwindSafe for DistributedGoalResolver
impl Send for DistributedGoalResolver
impl Sync for DistributedGoalResolver
impl Unpin for DistributedGoalResolver
impl !UnwindSafe for DistributedGoalResolver
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