pub struct DistributedInferenceSession {
pub session_id: String,
pub goal: String,
pub local_results: Vec<String>,
pub remote_results: Vec<RemoteResult>,
pub pending_peers: HashSet<String>,
pub completed_peers: HashSet<String>,
pub started_at: Instant,
pub timeout: Duration,
}Expand description
Tracks a single distributed inference run from start to finish.
Fields§
§session_id: StringUnique identifier for this session (UUID v4).
goal: StringThe goal being proved (Datalog string).
local_results: Vec<String>Bindings resolved locally.
remote_results: Vec<RemoteResult>Results contributed by remote peers.
pending_peers: HashSet<String>Peers that have been queried but have not yet replied.
completed_peers: HashSet<String>Peers that have already replied (or been declared timed-out).
started_at: InstantWall-clock instant at which the session was created.
timeout: DurationHow long to wait for all peers before declaring the session timed-out.
Implementations§
Source§impl DistributedInferenceSession
impl DistributedInferenceSession
Sourcepub fn new(goal: &str, timeout: Duration) -> Self
pub fn new(goal: &str, timeout: Duration) -> Self
Construct a new session for goal with the given timeout.
Sourcepub fn is_complete(&self) -> bool
pub fn is_complete(&self) -> bool
Returns true once all registered peers have replied or the
timeout has elapsed.
A session that has had no peers registered is not considered complete (there is no outstanding work to declare done). It becomes complete either when every registered peer has replied or when the timeout fires.
Sourcepub fn is_expired(&self) -> bool
pub fn is_expired(&self) -> bool
Returns true when the session has exceeded its timeout.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for DistributedInferenceSession
impl RefUnwindSafe for DistributedInferenceSession
impl Send for DistributedInferenceSession
impl Sync for DistributedInferenceSession
impl Unpin for DistributedInferenceSession
impl UnsafeUnpin for DistributedInferenceSession
impl UnwindSafe for DistributedInferenceSession
Blanket Implementations§
impl<T> Allocation for T
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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>
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>
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