@@ -6,7 +6,6 @@ use futures_core::future::BoxFuture;
6
6
use futures_util:: FutureExt ;
7
7
use hashbrown:: HashMap ;
8
8
9
- use crate :: caching_connection:: CachingConnection ;
10
9
use crate :: common:: StatementCache ;
11
10
use crate :: connection:: { Connect , Connection } ;
12
11
use crate :: error:: Error ;
@@ -46,22 +45,6 @@ pub struct MySqlConnection {
46
45
scratch_row_column_names : Arc < HashMap < UStr , usize > > ,
47
46
}
48
47
49
- impl CachingConnection for MySqlConnection {
50
- fn cached_statements_count ( & self ) -> usize {
51
- self . cache_statement . len ( )
52
- }
53
-
54
- fn clear_cached_statements ( & mut self ) -> BoxFuture < ' _ , Result < ( ) , Error > > {
55
- Box :: pin ( async move {
56
- while let Some ( statement) = self . cache_statement . remove_lru ( ) {
57
- self . stream . send_packet ( StmtClose { statement } ) . await ?;
58
- }
59
-
60
- Ok ( ( ) )
61
- } )
62
- }
63
- }
64
-
65
48
impl Debug for MySqlConnection {
66
49
fn fmt ( & self , f : & mut Formatter < ' _ > ) -> fmt:: Result {
67
50
f. debug_struct ( "MySqlConnection" ) . finish ( )
@@ -94,6 +77,20 @@ impl Connection for MySqlConnection {
94
77
self . stream . wait_until_ready ( ) . boxed ( )
95
78
}
96
79
80
+ fn cached_statements_size ( & self ) -> usize {
81
+ self . cache_statement . len ( )
82
+ }
83
+
84
+ fn clear_cached_statements ( & mut self ) -> BoxFuture < ' _ , Result < ( ) , Error > > {
85
+ Box :: pin ( async move {
86
+ while let Some ( statement) = self . cache_statement . remove_lru ( ) {
87
+ self . stream . send_packet ( StmtClose { statement } ) . await ?;
88
+ }
89
+
90
+ Ok ( ( ) )
91
+ } )
92
+ }
93
+
97
94
#[ doc( hidden) ]
98
95
fn should_flush ( & self ) -> bool {
99
96
!self . stream . wbuf . is_empty ( )
0 commit comments