Struct libp2p::kad::QueryStats[][src]

pub struct QueryStats { /* fields omitted */ }

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]

impl Debug for QueryStats[src]

impl Eq for QueryStats[src]

impl PartialEq<QueryStats> 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> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T[src]

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>, 
[src]