MCPcopy Create free account
hub / github.com/erans/pgsqlite / drop

Method drop

src/session/pool.rs:343–353  ·  view source on GitHub ↗
(&mut self)

Source from the content-addressed store, hash-verified

341
342impl Drop for PooledConnection {
343 fn drop(&mut self) {
344 if let Some(conn) = self.conn.take() {
345 let mut conns = self.pool.lock().unwrap();
346 let mut stats = self.stats.lock().unwrap();
347
348 // Return connection to pool wrapped in PoolConnection
349 conns.push(PoolConnection::new(conn));
350 stats.idle_connections += 1;
351 stats.active_connections = stats.active_connections.saturating_sub(1);
352 }
353 }
354}
355
356#[cfg(test)]

Callers

nothing calls this directly

Calls 1

takeMethod · 0.80

Tested by

no test coverage detected