From 8d24dfc0ef59c075e6918b87f22482a8ef56db93 Mon Sep 17 00:00:00 2001 From: Ryan Leckey Date: Thu, 25 Jun 2020 03:43:31 -0700 Subject: [PATCH] feat(cache): expose capacity on StatementCache --- sqlx-core/src/common/statement_cache.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sqlx-core/src/common/statement_cache.rs b/sqlx-core/src/common/statement_cache.rs index f0f108cf..6ce4fbde 100644 --- a/sqlx-core/src/common/statement_cache.rs +++ b/sqlx-core/src/common/statement_cache.rs @@ -58,4 +58,9 @@ impl StatementCache { pub fn contains_key(&mut self, k: &str) -> bool { self.inner.contains_key(k) } + + /// Returns the maximum number of statements the cache can hold. + pub fn capacity(&self) -> usize { + self.inner.capacity() + } }