pub trait Collect:
Clone
+ Send
+ Sync {
// Provided methods
fn connection_attempt(&self) { ... }
fn connection_error(&self) { ... }
fn connection_abort(&self) { ... }
fn connection(&self) { ... }
fn disconnect(&self) { ... }
fn blacklist_add(&self) { ... }
fn blacklist_remove(&self) { ... }
fn request_queued(&self) { ... }
fn request_forwarded(&self) { ... }
fn pool_closed(&self) { ... }
}Expand description
An object implementing trait may collect metrics of a connection pool
Provided Methods§
Sourcefn connection_attempt(&self)
fn connection_attempt(&self)
We started establishing connection
This pairs either with connection on success
or connection_abort and connection_error on error
Sourcefn connection_error(&self)
fn connection_error(&self)
Error establishing connection
Sourcefn connection_abort(&self)
fn connection_abort(&self)
Aborted connection attempt (name changed, and doesn’t include address)
Sourcefn connection(&self)
fn connection(&self)
Connection established successfully
Sourcefn disconnect(&self)
fn disconnect(&self)
Connection closed (usully means name changed)
Sourcefn blacklist_add(&self)
fn blacklist_add(&self)
Host address added to a blacklist (i.e. connection error)
Sourcefn blacklist_remove(&self)
fn blacklist_remove(&self)
Host address removed from a blacklist
Note this callback is only called when we’re searching for a new connection and all others are busy. I.e. unlisting a host from a blacklist may be delayed arbitrarily when not under backpressure. This may be fixed in future.
Sourcefn request_queued(&self)
fn request_queued(&self)
Request queued in the internal queue
Sourcefn request_forwarded(&self)
fn request_forwarded(&self)
Request unqueued from the internal queue and forwarded to a sink
Note: this might not mean that request is already sent as we can’t control the underlying sinks used.
Sourcefn pool_closed(&self)
fn pool_closed(&self)
Connection pool is closed
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.