pub struct QueryHealth<ChildId> { /* private fields */ }Expand description
Health metadata for a distributed query result.
Implementations§
Source§impl<ChildId> QueryHealth<ChildId>
impl<ChildId> QueryHealth<ChildId>
Sourcepub fn with_expected_children(expected_children: usize) -> Self
pub fn with_expected_children(expected_children: usize) -> Self
Creates health metadata with an expected child count.
Sourcepub fn expected_children(&self) -> usize
pub fn expected_children(&self) -> usize
Returns the expected child count.
Sourcepub fn completed_children(&self) -> usize
pub fn completed_children(&self) -> usize
Returns the completed child count.
Sourcepub fn issues(&self) -> &[ChildIssue<ChildId>]
pub fn issues(&self) -> &[ChildIssue<ChildId>]
Returns all recorded issues.
Sourcepub fn record_completed(&mut self)
pub fn record_completed(&mut self)
Records a completed child response.
Sourcepub fn record_issue(&mut self, issue: ChildIssue<ChildId>)
pub fn record_issue(&mut self, issue: ChildIssue<ChildId>)
Records an issue.
Sourcepub fn push_issue(
&mut self,
child: ChildId,
kind: IssueKind,
detail: impl Into<String>,
)
pub fn push_issue( &mut self, child: ChildId, kind: IssueKind, detail: impl Into<String>, )
Records an issue by parts.
Sourcepub fn is_partial(&self) -> bool
pub fn is_partial(&self) -> bool
Returns true if any issue has been recorded or some expected children did not complete.
Sourcepub fn completeness(&self) -> f64
pub fn completeness(&self) -> f64
Returns the completed-child ratio in 0.0..=1.0.
Trait Implementations§
Source§impl<ChildId: Clone> Clone for QueryHealth<ChildId>
impl<ChildId: Clone> Clone for QueryHealth<ChildId>
Source§fn clone(&self) -> QueryHealth<ChildId>
fn clone(&self) -> QueryHealth<ChildId>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<ChildId: Debug> Debug for QueryHealth<ChildId>
impl<ChildId: Debug> Debug for QueryHealth<ChildId>
Source§impl<ChildId> Default for QueryHealth<ChildId>
impl<ChildId> Default for QueryHealth<ChildId>
Source§impl<ChildId: PartialEq> PartialEq for QueryHealth<ChildId>
impl<ChildId: PartialEq> PartialEq for QueryHealth<ChildId>
impl<ChildId: Eq> Eq for QueryHealth<ChildId>
impl<ChildId> StructuralPartialEq for QueryHealth<ChildId>
Auto Trait Implementations§
impl<ChildId> Freeze for QueryHealth<ChildId>
impl<ChildId> RefUnwindSafe for QueryHealth<ChildId>where
ChildId: RefUnwindSafe,
impl<ChildId> Send for QueryHealth<ChildId>where
ChildId: Send,
impl<ChildId> Sync for QueryHealth<ChildId>where
ChildId: Sync,
impl<ChildId> Unpin for QueryHealth<ChildId>where
ChildId: Unpin,
impl<ChildId> UnsafeUnpin for QueryHealth<ChildId>
impl<ChildId> UnwindSafe for QueryHealth<ChildId>where
ChildId: UnwindSafe,
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