Struct libp2p::kad::QueryStats [−][src]
Execution statistics of a query.
Implementations
impl QueryStats
[src]
pub fn empty() -> QueryStats
[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]
Gets the number of successful requests.
pub fn num_failures(&self) -> u32
[src]
Gets the number of failed requests.
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]
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]
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]
pub fn clone(&self) -> QueryStats
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for QueryStats
[src]
impl Eq for QueryStats
[src]
impl PartialEq<QueryStats> for QueryStats
[src]
pub fn eq(&self, other: &QueryStats) -> bool
[src]
pub fn ne(&self, other: &QueryStats) -> bool
[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> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
[src]
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
[src]
V: MultiLane<T>,