pub trait Pingable {
// Required method
fn ping(&mut self);
}Expand description
Represents a component that can be “pinged” to keep a connection alive.
Required Methods§
Sourcefn ping(&mut self)
fn ping(&mut self)
Pings the database to check connection health and prevent timeouts.
This function executes a lightweight query to ensure the connection is still
active. If the ping fails, it logs an error using log::error! but does
not propagate the error to the caller. This is a “fire-and-forget”
keep-alive mechanism.