Struct libp2p::kad::QueryStats [−][src]
pub struct QueryStats { /* fields omitted */ }
Expand description
Execution statistics of a query.
Implementations
impl QueryStats
[src]
impl QueryStats
[src]pub fn empty() -> QueryStats
[src]
pub fn num_requests(&self) -> u32
[src]
pub fn num_requests(&self) -> u32
[src]Gets the total number of requests initiated by the query.
pub fn num_successes(&self) -> u32
[src]
pub fn num_successes(&self) -> u32
[src]Gets the number of successful requests.
pub fn num_failures(&self) -> u32
[src]
pub fn num_failures(&self) -> u32
[src]Gets the number of failed requests.
pub fn num_pending(&self) -> u32
[src]
pub fn num_pending(&self) -> u32
[src]Gets the number of pending requests.
Note: A query can finish while still having pending requests, if the termination conditions are already met.
pub fn duration(&self) -> Option<Duration>
[src]
pub fn duration(&self) -> Option<Duration>
[src]Gets the duration of the query.
If the query has not yet finished, the duration is measured from the start of the query to the current instant.
If the query did not yet start (i.e. yield the first peer to contact),
None
is returned.
pub fn merge(self, other: QueryStats) -> QueryStats
[src]
pub fn merge(self, other: QueryStats) -> QueryStats
[src]Merges these stats with the given stats of another query, e.g. to accumulate statistics from a multi-phase query.
Counters are merged cumulatively while the instants for start and end of the queries are taken as the minimum and maximum, respectively.
Trait Implementations
impl Clone for QueryStats
[src]
impl Clone for QueryStats
[src]pub fn clone(&self) -> QueryStats
[src]
pub fn clone(&self) -> QueryStats
[src]Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]Performs copy-assignment from source
. Read more
impl Debug for QueryStats
[src]
impl Debug for QueryStats
[src]impl PartialEq<QueryStats> for QueryStats
[src]
impl PartialEq<QueryStats> for QueryStats
[src]pub fn eq(&self, other: &QueryStats) -> bool
[src]
pub fn eq(&self, other: &QueryStats) -> bool
[src]This method tests for self
and other
values to be equal, and is used
by ==
. Read more
pub fn ne(&self, other: &QueryStats) -> bool
[src]
pub fn ne(&self, other: &QueryStats) -> bool
[src]This method tests for !=
.
impl Eq for QueryStats
[src]
impl StructuralEq for QueryStats
[src]
impl StructuralPartialEq for QueryStats
[src]
Auto Trait Implementations
impl RefUnwindSafe for QueryStats
impl Send for QueryStats
impl Sync for QueryStats
impl Unpin for QueryStats
impl UnwindSafe for QueryStats
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]
pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more
impl<T> ToOwned for T where
T: Clone,
[src]
impl<T> ToOwned for T where
T: Clone,
[src]type Owned = T
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn to_owned(&self) -> T
[src]Creates owned data from borrowed data, usually by cloning. Read more
pub fn clone_into(&self, target: &mut T)
[src]
pub fn clone_into(&self, target: &mut T)
[src]🔬 This is a nightly-only experimental API. (toowned_clone_into
)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,