ErrorLog

Trait ErrorLog 

Source
pub trait ErrorLog {
    type ConnectionError;
    type SinkError;

    // Provided methods
    fn connection_error(&self, _addr: SocketAddr, _e: Self::ConnectionError) { ... }
    fn sink_error(&self, _addr: SocketAddr, _e: Self::SinkError) { ... }
    fn pool_shutting_down(&self, _reason: ShutdownReason) { ... }
    fn pool_closed(&self) { ... }
}
Expand description

The thrait that has appropriate hooks for logging different events

There is a default WarnLogger, but the idea is that you may give connection pool a name, change logging levels, and do other interesting stuff in your own error log handler.

Required Associated Types§

Source

type ConnectionError

Connection error type that is returned by connect/hanshake function

Source

type SinkError

Error when sending request returned by Sink

Provided Methods§

Source

fn connection_error(&self, _addr: SocketAddr, _e: Self::ConnectionError)

Error when establishing a new connection

Source

fn sink_error(&self, _addr: SocketAddr, _e: Self::SinkError)

Error when sending a request

This also means connection is closed

Source

fn pool_shutting_down(&self, _reason: ShutdownReason)

Pool is started to shut down for the specified reason

Source

fn pool_closed(&self)

Pool is fully closed at this moment

Implementors§