mirror of
https://github.com/chatmail/core.git
synced 2026-05-19 23:06:32 +03:00
Derive Debug for Pool
This commit is contained in:
@@ -1,6 +1,5 @@
|
|||||||
//! Connection pool.
|
//! Connection pool.
|
||||||
|
|
||||||
use std::fmt;
|
|
||||||
use std::ops::{Deref, DerefMut};
|
use std::ops::{Deref, DerefMut};
|
||||||
use std::sync::{Arc, Weak};
|
use std::sync::{Arc, Weak};
|
||||||
|
|
||||||
@@ -9,6 +8,7 @@ use rusqlite::Connection;
|
|||||||
use tokio::sync::Notify;
|
use tokio::sync::Notify;
|
||||||
|
|
||||||
/// Inner connection pool.
|
/// Inner connection pool.
|
||||||
|
#[derive(Debug)]
|
||||||
struct InnerPool {
|
struct InnerPool {
|
||||||
/// Available connections.
|
/// Available connections.
|
||||||
connections: ArrayQueue<Connection>,
|
connections: ArrayQueue<Connection>,
|
||||||
@@ -64,18 +64,12 @@ impl DerefMut for PooledConnection {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Connection pool.
|
/// Connection pool.
|
||||||
#[derive(Clone)]
|
#[derive(Clone, Debug)]
|
||||||
pub struct Pool {
|
pub struct Pool {
|
||||||
/// Reference to the actual connection pool.
|
/// Reference to the actual connection pool.
|
||||||
inner: Arc<InnerPool>,
|
inner: Arc<InnerPool>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl fmt::Debug for Pool {
|
|
||||||
fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
|
|
||||||
write!(fmt, "Pool")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
impl Pool {
|
impl Pool {
|
||||||
/// Creates a new connection pool.
|
/// Creates a new connection pool.
|
||||||
pub fn new(connections: Vec<Connection>) -> Self {
|
pub fn new(connections: Vec<Connection>) -> Self {
|
||||||
|
|||||||
Reference in New Issue
Block a user